diff --git a/Cargo.toml b/Cargo.toml index 83b8fd4..8700ac1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,8 @@ authors = [ description = "A rust implementation of the mpd protocol, both client and serverside" repository = "https://git.pvv.ntnu.no/Grzegorz/empidee" documentation = "https://pages.pvv.ntnu.no/Grzegorz/empidee/main/docs/empidee/" -edition = "2021" -rust-version = "1.83.0" +edition = "2024" +rust-version = "1.85.0" [dependencies] serde = { version = "1.0.210", features = ["derive"] } diff --git a/flake.lock b/flake.lock index 8f6836d..c7877b2 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1739866667, - "narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=", + "lastModified": 1740367490, + "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680", + "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05", "type": "github" }, "original": { @@ -29,11 +29,11 @@ ] }, "locked": { - "lastModified": 1740277845, - "narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=", + "lastModified": 1740536993, + "narHash": "sha256-3YI+1ONZ28chM19Hep9Z+TSyiybYf/1VC/gwImVZKUw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "f933070c29f9c1c5457447a51903f27f76ebb519", + "rev": "9f05c0655de9dc2c7b60b689447c48abb9190bf8", "type": "github" }, "original": { diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..3501136 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +style_edition = "2024" diff --git a/src/commands/client_to_client/channels.rs b/src/commands/client_to_client/channels.rs index f88f5f5..b119763 100644 --- a/src/commands/client_to_client/channels.rs +++ b/src/commands/client_to_client/channels.rs @@ -1,8 +1,8 @@ use serde::{Deserialize, Serialize}; use crate::commands::{ - expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + expect_property_type, }; pub struct Channels; diff --git a/src/commands/client_to_client/readmessages.rs b/src/commands/client_to_client/readmessages.rs index 2861a50..cf2aea5 100644 --- a/src/commands/client_to_client/readmessages.rs +++ b/src/commands/client_to_client/readmessages.rs @@ -1,8 +1,8 @@ use serde::{Deserialize, Serialize}; use crate::commands::{ - expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + expect_property_type, }; pub struct ReadMessages; diff --git a/src/commands/connection_settings/protocol.rs b/src/commands/connection_settings/protocol.rs index fe16f16..6f0b312 100644 --- a/src/commands/connection_settings/protocol.rs +++ b/src/commands/connection_settings/protocol.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct Protocol; diff --git a/src/commands/connection_settings/protocol_all.rs b/src/commands/connection_settings/protocol_all.rs index 318657e..86405a9 100644 --- a/src/commands/connection_settings/protocol_all.rs +++ b/src/commands/connection_settings/protocol_all.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct ProtocolAll; diff --git a/src/commands/connection_settings/protocol_available.rs b/src/commands/connection_settings/protocol_available.rs index 02dab77..4e89a5d 100644 --- a/src/commands/connection_settings/protocol_available.rs +++ b/src/commands/connection_settings/protocol_available.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct ProtocolAvailable; diff --git a/src/commands/connection_settings/protocol_clear.rs b/src/commands/connection_settings/protocol_clear.rs index b698d3f..b1f3505 100644 --- a/src/commands/connection_settings/protocol_clear.rs +++ b/src/commands/connection_settings/protocol_clear.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct ProtocolClear; diff --git a/src/commands/connection_settings/protocol_disable.rs b/src/commands/connection_settings/protocol_disable.rs index d4ad89b..e8b6b9f 100644 --- a/src/commands/connection_settings/protocol_disable.rs +++ b/src/commands/connection_settings/protocol_disable.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct ProtocolDisable; diff --git a/src/commands/connection_settings/protocol_enable.rs b/src/commands/connection_settings/protocol_enable.rs index 42b3c7d..ae2caf5 100644 --- a/src/commands/connection_settings/protocol_enable.rs +++ b/src/commands/connection_settings/protocol_enable.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct ProtocolEnable; diff --git a/src/commands/connection_settings/tag_types.rs b/src/commands/connection_settings/tag_types.rs index 9596149..74b3d91 100644 --- a/src/commands/connection_settings/tag_types.rs +++ b/src/commands/connection_settings/tag_types.rs @@ -30,7 +30,7 @@ impl Command for TagTypes { GenericResponseValue::Binary(_) => { return Err(ResponseParserError::UnexpectedPropertyType( "tagtype", "Binary", - )) + )); } }; diff --git a/src/commands/connection_settings/tag_types_all.rs b/src/commands/connection_settings/tag_types_all.rs index cb12ac3..ddd9fb9 100644 --- a/src/commands/connection_settings/tag_types_all.rs +++ b/src/commands/connection_settings/tag_types_all.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct TagTypesAll; diff --git a/src/commands/connection_settings/tag_types_available.rs b/src/commands/connection_settings/tag_types_available.rs index 1628cac..43f80b4 100644 --- a/src/commands/connection_settings/tag_types_available.rs +++ b/src/commands/connection_settings/tag_types_available.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct TagTypesAvailable; diff --git a/src/commands/connection_settings/tag_types_clear.rs b/src/commands/connection_settings/tag_types_clear.rs index 44fc672..27dc3ab 100644 --- a/src/commands/connection_settings/tag_types_clear.rs +++ b/src/commands/connection_settings/tag_types_clear.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct TagTypesClear; diff --git a/src/commands/connection_settings/tag_types_disable.rs b/src/commands/connection_settings/tag_types_disable.rs index 85550ba..92ca0e8 100644 --- a/src/commands/connection_settings/tag_types_disable.rs +++ b/src/commands/connection_settings/tag_types_disable.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct TagTypesDisable; diff --git a/src/commands/connection_settings/tag_types_enable.rs b/src/commands/connection_settings/tag_types_enable.rs index 0d78df9..3154431 100644 --- a/src/commands/connection_settings/tag_types_enable.rs +++ b/src/commands/connection_settings/tag_types_enable.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct TagTypesEnable; diff --git a/src/commands/connection_settings/tag_types_reset.rs b/src/commands/connection_settings/tag_types_reset.rs index 31880a1..0c91757 100644 --- a/src/commands/connection_settings/tag_types_reset.rs +++ b/src/commands/connection_settings/tag_types_reset.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct TagTypesReset; diff --git a/src/commands/mounts_and_neighbors/listmounts.rs b/src/commands/mounts_and_neighbors/listmounts.rs index c971add..3913f57 100644 --- a/src/commands/mounts_and_neighbors/listmounts.rs +++ b/src/commands/mounts_and_neighbors/listmounts.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct ListMounts; diff --git a/src/commands/mounts_and_neighbors/listneighbors.rs b/src/commands/mounts_and_neighbors/listneighbors.rs index 89a5156..dd15910 100644 --- a/src/commands/mounts_and_neighbors/listneighbors.rs +++ b/src/commands/mounts_and_neighbors/listneighbors.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct ListNeighbors; diff --git a/src/commands/mounts_and_neighbors/mount.rs b/src/commands/mounts_and_neighbors/mount.rs index 8df78cb..c639af8 100644 --- a/src/commands/mounts_and_neighbors/mount.rs +++ b/src/commands/mounts_and_neighbors/mount.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct Mount; diff --git a/src/commands/mounts_and_neighbors/unmount.rs b/src/commands/mounts_and_neighbors/unmount.rs index 74ea281..5f0beb6 100644 --- a/src/commands/mounts_and_neighbors/unmount.rs +++ b/src/commands/mounts_and_neighbors/unmount.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct Unmount; diff --git a/src/commands/music_database/albumart.rs b/src/commands/music_database/albumart.rs index eaac7f1..ee0125f 100644 --- a/src/commands/music_database/albumart.rs +++ b/src/commands/music_database/albumart.rs @@ -2,8 +2,8 @@ use std::collections::HashMap; use crate::{ commands::{ - get_and_parse_property, get_property, Command, Request, RequestParserError, - RequestParserResult, ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, get_and_parse_property, get_property, }, common::Offset, }; diff --git a/src/commands/music_database/count.rs b/src/commands/music_database/count.rs index a410554..d8c614b 100644 --- a/src/commands/music_database/count.rs +++ b/src/commands/music_database/count.rs @@ -2,8 +2,8 @@ use std::collections::HashMap; use crate::{ commands::{ - get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, get_and_parse_property, }, filter::parse_filter, }; diff --git a/src/commands/music_database/getfingerprint.rs b/src/commands/music_database/getfingerprint.rs index 7296778..1c6bef3 100644 --- a/src/commands/music_database/getfingerprint.rs +++ b/src/commands/music_database/getfingerprint.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use crate::commands::{ - get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, get_and_parse_property, }; pub struct GetFingerprint; diff --git a/src/commands/music_database/list.rs b/src/commands/music_database/list.rs index 00092e2..3be9406 100644 --- a/src/commands/music_database/list.rs +++ b/src/commands/music_database/list.rs @@ -1,7 +1,7 @@ use crate::{ commands::{ - expect_property_type, Command, Request, RequestParserError, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, expect_property_type, }, filter::parse_filter, }; diff --git a/src/commands/music_database/readpicture.rs b/src/commands/music_database/readpicture.rs index 91c5c98..bfa76cb 100644 --- a/src/commands/music_database/readpicture.rs +++ b/src/commands/music_database/readpicture.rs @@ -2,8 +2,8 @@ use std::collections::HashMap; use crate::{ commands::{ - get_and_parse_property, get_optional_property, get_property, Command, Request, - RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, get_and_parse_property, get_optional_property, get_property, }, common::Offset, }; diff --git a/src/commands/music_database/rescan.rs b/src/commands/music_database/rescan.rs index 29d3e83..6c8f223 100644 --- a/src/commands/music_database/rescan.rs +++ b/src/commands/music_database/rescan.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use crate::commands::{ - get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + get_and_parse_property, }; pub struct Rescan; diff --git a/src/commands/music_database/searchcount.rs b/src/commands/music_database/searchcount.rs index a9bd6e9..3cb00da 100644 --- a/src/commands/music_database/searchcount.rs +++ b/src/commands/music_database/searchcount.rs @@ -2,8 +2,8 @@ use std::collections::HashMap; use crate::{ commands::{ - get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, get_and_parse_property, }, filter::parse_filter, }; diff --git a/src/commands/music_database/update.rs b/src/commands/music_database/update.rs index 7b9232d..137c248 100644 --- a/src/commands/music_database/update.rs +++ b/src/commands/music_database/update.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use crate::commands::{ - get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + get_and_parse_property, }; pub struct Update; diff --git a/src/commands/partition_commands/listpartitions.rs b/src/commands/partition_commands/listpartitions.rs index 0af883c..f5ca345 100644 --- a/src/commands/partition_commands/listpartitions.rs +++ b/src/commands/partition_commands/listpartitions.rs @@ -1,6 +1,6 @@ use crate::commands::{ - expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + expect_property_type, }; pub struct ListPartitions; diff --git a/src/commands/playback_options/getvol.rs b/src/commands/playback_options/getvol.rs index 3394aa6..1befdca 100644 --- a/src/commands/playback_options/getvol.rs +++ b/src/commands/playback_options/getvol.rs @@ -2,8 +2,8 @@ use std::collections::HashMap; use crate::{ commands::{ - get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + get_and_parse_property, }, common::VolumeValue, }; diff --git a/src/commands/playback_options/replay_gain_status.rs b/src/commands/playback_options/replay_gain_status.rs index 8ceeb3b..7eb0d9a 100644 --- a/src/commands/playback_options/replay_gain_status.rs +++ b/src/commands/playback_options/replay_gain_status.rs @@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize}; use crate::{ commands::{ - get_property, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + get_property, }, common::ReplayGainModeMode, }; diff --git a/src/commands/querying_mpd_status/stats.rs b/src/commands/querying_mpd_status/stats.rs index babfbb0..a9343b1 100644 --- a/src/commands/querying_mpd_status/stats.rs +++ b/src/commands/querying_mpd_status/stats.rs @@ -3,8 +3,8 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use crate::commands::{ - get_and_parse_optional_property, get_and_parse_property, Command, Request, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + get_and_parse_optional_property, get_and_parse_property, }; pub struct Stats; diff --git a/src/commands/querying_mpd_status/status.rs b/src/commands/querying_mpd_status/status.rs index 768bf4a..363ce20 100644 --- a/src/commands/querying_mpd_status/status.rs +++ b/src/commands/querying_mpd_status/status.rs @@ -6,9 +6,9 @@ use serde::{Deserialize, Serialize}; use crate::common::{Audio, BoolOrOneshot, SongId, SongPosition}; use crate::commands::{ - get_and_parse_optional_property, get_and_parse_property, get_optional_property, get_property, Command, GenericResponseValue, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + ResponseParserError, get_and_parse_optional_property, get_and_parse_property, + get_optional_property, get_property, }; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] diff --git a/src/commands/queue/addid.rs b/src/commands/queue/addid.rs index bb3ecd5..e3bfaf9 100644 --- a/src/commands/queue/addid.rs +++ b/src/commands/queue/addid.rs @@ -1,7 +1,7 @@ use crate::{ commands::{ - get_next_and_parse_property, Command, Request, RequestParserError, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, get_next_and_parse_property, }, common::{SongId, SongPosition}, }; diff --git a/src/commands/queue/addtagid.rs b/src/commands/queue/addtagid.rs index c55eaa7..4610922 100644 --- a/src/commands/queue/addtagid.rs +++ b/src/commands/queue/addtagid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct AddTagId; diff --git a/src/commands/queue/cleartagid.rs b/src/commands/queue/cleartagid.rs index c3bed99..516e1e5 100644 --- a/src/commands/queue/cleartagid.rs +++ b/src/commands/queue/cleartagid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct ClearTagId; diff --git a/src/commands/queue/delete.rs b/src/commands/queue/delete.rs index 35228ec..77f1ae7 100644 --- a/src/commands/queue/delete.rs +++ b/src/commands/queue/delete.rs @@ -1,11 +1,11 @@ use std::str::FromStr; use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, common::OneOrRange, - Request, }; pub struct Delete; diff --git a/src/commands/queue/deleteid.rs b/src/commands/queue/deleteid.rs index e3223bf..b94e254 100644 --- a/src/commands/queue/deleteid.rs +++ b/src/commands/queue/deleteid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct DeleteId; diff --git a/src/commands/queue/move_.rs b/src/commands/queue/move_.rs index 5ec2b17..449458e 100644 --- a/src/commands/queue/move_.rs +++ b/src/commands/queue/move_.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct Move; diff --git a/src/commands/queue/moveid.rs b/src/commands/queue/moveid.rs index 5a7d4ad..fdded4f 100644 --- a/src/commands/queue/moveid.rs +++ b/src/commands/queue/moveid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct MoveId; diff --git a/src/commands/queue/playlist.rs b/src/commands/queue/playlist.rs index 91529ee..543ecf6 100644 --- a/src/commands/queue/playlist.rs +++ b/src/commands/queue/playlist.rs @@ -1,6 +1,6 @@ use crate::{ - commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, Request, + commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError}, }; pub struct Playlist; diff --git a/src/commands/queue/playlistfind.rs b/src/commands/queue/playlistfind.rs index f469158..e80cb1d 100644 --- a/src/commands/queue/playlistfind.rs +++ b/src/commands/queue/playlistfind.rs @@ -1,9 +1,9 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, filter::parse_filter, - Request, }; pub struct PlaylistFind; diff --git a/src/commands/queue/playlistid.rs b/src/commands/queue/playlistid.rs index 290574a..941c4dd 100644 --- a/src/commands/queue/playlistid.rs +++ b/src/commands/queue/playlistid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct PlaylistId; diff --git a/src/commands/queue/playlistinfo.rs b/src/commands/queue/playlistinfo.rs index 898a91c..f83dcf8 100644 --- a/src/commands/queue/playlistinfo.rs +++ b/src/commands/queue/playlistinfo.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct PlaylistInfo; diff --git a/src/commands/queue/playlistsearch.rs b/src/commands/queue/playlistsearch.rs index 9400b15..1571794 100644 --- a/src/commands/queue/playlistsearch.rs +++ b/src/commands/queue/playlistsearch.rs @@ -1,9 +1,9 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, filter::parse_filter, - Request, }; pub struct PlaylistSearch; diff --git a/src/commands/queue/plchanges.rs b/src/commands/queue/plchanges.rs index f80e535..e4385c4 100644 --- a/src/commands/queue/plchanges.rs +++ b/src/commands/queue/plchanges.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct PlChanges; diff --git a/src/commands/queue/plchangesposid.rs b/src/commands/queue/plchangesposid.rs index 445e74b..ff10424 100644 --- a/src/commands/queue/plchangesposid.rs +++ b/src/commands/queue/plchangesposid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct PlChangesPosId; diff --git a/src/commands/queue/prio.rs b/src/commands/queue/prio.rs index dda0455..8c5bf6c 100644 --- a/src/commands/queue/prio.rs +++ b/src/commands/queue/prio.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct Prio; diff --git a/src/commands/queue/prioid.rs b/src/commands/queue/prioid.rs index 42a93f9..e1cb39b 100644 --- a/src/commands/queue/prioid.rs +++ b/src/commands/queue/prioid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct PrioId; diff --git a/src/commands/queue/rangeid.rs b/src/commands/queue/rangeid.rs index 38c0681..fa13c5c 100644 --- a/src/commands/queue/rangeid.rs +++ b/src/commands/queue/rangeid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct RangeId; diff --git a/src/commands/queue/shuffle.rs b/src/commands/queue/shuffle.rs index d96b45d..db45423 100644 --- a/src/commands/queue/shuffle.rs +++ b/src/commands/queue/shuffle.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct Shuffle; diff --git a/src/commands/queue/swap.rs b/src/commands/queue/swap.rs index de0bdd7..9cadf41 100644 --- a/src/commands/queue/swap.rs +++ b/src/commands/queue/swap.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct Swap; diff --git a/src/commands/queue/swapid.rs b/src/commands/queue/swapid.rs index 6218ded..e202d46 100644 --- a/src/commands/queue/swapid.rs +++ b/src/commands/queue/swapid.rs @@ -1,8 +1,8 @@ use crate::{ + Request, commands::{ Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, }, - Request, }; pub struct SwapId; diff --git a/src/commands/reflection/commands.rs b/src/commands/reflection/commands.rs index 395fa4b..3a36cb9 100644 --- a/src/commands/reflection/commands.rs +++ b/src/commands/reflection/commands.rs @@ -30,7 +30,7 @@ impl Command for Commands { GenericResponseValue::Binary(_) => { return Err(ResponseParserError::UnexpectedPropertyType( "handler", "Binary", - )) + )); } }; result.push(value.to_string()); diff --git a/src/commands/reflection/config.rs b/src/commands/reflection/config.rs index 5ee4c4d..7e15cc9 100644 --- a/src/commands/reflection/config.rs +++ b/src/commands/reflection/config.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use crate::commands::{ - get_and_parse_property, get_property, Command, Request, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + get_and_parse_property, get_property, }; pub struct Config; diff --git a/src/commands/reflection/not_commands.rs b/src/commands/reflection/not_commands.rs index 482c318..a194e61 100644 --- a/src/commands/reflection/not_commands.rs +++ b/src/commands/reflection/not_commands.rs @@ -30,7 +30,7 @@ impl Command for NotCommands { GenericResponseValue::Binary(_) => { return Err(ResponseParserError::UnexpectedPropertyType( "handler", "Binary", - )) + )); } }; result.push(value.to_string()); diff --git a/src/commands/reflection/url_handlers.rs b/src/commands/reflection/url_handlers.rs index 5f1c087..1841f3c 100644 --- a/src/commands/reflection/url_handlers.rs +++ b/src/commands/reflection/url_handlers.rs @@ -30,7 +30,7 @@ impl Command for UrlHandlers { GenericResponseValue::Binary(_) => { return Err(ResponseParserError::UnexpectedPropertyType( "handler", "Binary", - )) + )); } }; url_handlers.push(value.to_string()); diff --git a/src/commands/stickers/sticker_find.rs b/src/commands/stickers/sticker_find.rs index 1128136..17ad414 100644 --- a/src/commands/stickers/sticker_find.rs +++ b/src/commands/stickers/sticker_find.rs @@ -87,7 +87,7 @@ impl Command for StickerFind { let uri = match uri.1 { GenericResponseValue::Text(s) => s.to_string(), GenericResponseValue::Binary(_) => { - return Err(ResponseParserError::UnexpectedPropertyType(uri.0, "Binary")) + return Err(ResponseParserError::UnexpectedPropertyType(uri.0, "Binary")); } }; @@ -96,7 +96,7 @@ impl Command for StickerFind { GenericResponseValue::Binary(_) => { return Err(ResponseParserError::UnexpectedPropertyType( "sticker", "Binary", - )) + )); } }; diff --git a/src/commands/stickers/sticker_get.rs b/src/commands/stickers/sticker_get.rs index 9a31582..7483586 100644 --- a/src/commands/stickers/sticker_get.rs +++ b/src/commands/stickers/sticker_get.rs @@ -1,6 +1,6 @@ use crate::commands::{ - get_next_property, Command, Request, RequestParserError, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, get_next_property, }; pub struct StickerGet; diff --git a/src/commands/stickers/stickernames.rs b/src/commands/stickers/stickernames.rs index 0ca4db1..dc5543b 100644 --- a/src/commands/stickers/stickernames.rs +++ b/src/commands/stickers/stickernames.rs @@ -1,6 +1,6 @@ use crate::commands::{ - expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + expect_property_type, }; pub struct StickerNames; diff --git a/src/commands/stickers/stickernamestypes.rs b/src/commands/stickers/stickernamestypes.rs index e39b9c1..03caa59 100644 --- a/src/commands/stickers/stickernamestypes.rs +++ b/src/commands/stickers/stickernamestypes.rs @@ -39,7 +39,7 @@ impl Command for StickerNamesTypes { GenericResponseValue::Binary(_) => { return Err(ResponseParserError::UnexpectedPropertyType( "name", "Binary", - )) + )); } }; @@ -48,7 +48,7 @@ impl Command for StickerNamesTypes { GenericResponseValue::Binary(_) => { return Err(ResponseParserError::UnexpectedPropertyType( "type", "Binary", - )) + )); } }; diff --git a/src/commands/stickers/stickertypes.rs b/src/commands/stickers/stickertypes.rs index b20a011..7486ec4 100644 --- a/src/commands/stickers/stickertypes.rs +++ b/src/commands/stickers/stickertypes.rs @@ -1,6 +1,6 @@ use crate::commands::{ - expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, - ResponseParserError, + Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError, + expect_property_type, }; pub struct StickerTypes; diff --git a/src/commands/stored_playlists/playlistlength.rs b/src/commands/stored_playlists/playlistlength.rs index e234f2d..535c31c 100644 --- a/src/commands/stored_playlists/playlistlength.rs +++ b/src/commands/stored_playlists/playlistlength.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use crate::commands::{ - get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, - ResponseAttributes, ResponseParserError, + Command, Request, RequestParserError, RequestParserResult, ResponseAttributes, + ResponseParserError, get_and_parse_property, }; pub struct PlaylistLength; diff --git a/src/request.rs b/src/request.rs index d1676dd..02c56ef 100644 --- a/src/request.rs +++ b/src/request.rs @@ -239,7 +239,7 @@ impl Request { .ok_or(RequestParserError::MissingCommandListEnd(i))?; match line.trim() { "command_list_begin" => { - return Err(RequestParserError::NestedCommandList(i)) + return Err(RequestParserError::NestedCommandList(i)); } "command_list_end" => { return Ok((Request::CommandList(commands), rest)); diff --git a/src/server.rs b/src/server.rs index 11f8309..ea5b822 100644 --- a/src/server.rs +++ b/src/server.rs @@ -1,4 +1,4 @@ -use crate::{common::SubSystem, Request, Response}; +use crate::{Request, Response, common::SubSystem}; pub trait MPDServer { type Error;