Rust edition 2024
Some checks failed
Build and test / build (push) Successful in 59s
Build and test / check (push) Failing after 1m2s
Build and test / test (push) Successful in 1m42s
Build and test / docs (push) Successful in 1m19s

This commit is contained in:
2025-02-26 16:39:34 +01:00
parent 58a06bd930
commit e910d29aa4
67 changed files with 96 additions and 95 deletions

View File

@@ -7,8 +7,8 @@ authors = [
description = "A rust implementation of the mpd protocol, both client and serverside" description = "A rust implementation of the mpd protocol, both client and serverside"
repository = "https://git.pvv.ntnu.no/Grzegorz/empidee" repository = "https://git.pvv.ntnu.no/Grzegorz/empidee"
documentation = "https://pages.pvv.ntnu.no/Grzegorz/empidee/main/docs/empidee/" documentation = "https://pages.pvv.ntnu.no/Grzegorz/empidee/main/docs/empidee/"
edition = "2021" edition = "2024"
rust-version = "1.83.0" rust-version = "1.85.0"
[dependencies] [dependencies]
serde = { version = "1.0.210", features = ["derive"] } serde = { version = "1.0.210", features = ["derive"] }

12
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1739866667, "lastModified": 1740367490,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=", "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680", "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -29,11 +29,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1740277845, "lastModified": 1740536993,
"narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=", "narHash": "sha256-3YI+1ONZ28chM19Hep9Z+TSyiybYf/1VC/gwImVZKUw=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "f933070c29f9c1c5457447a51903f27f76ebb519", "rev": "9f05c0655de9dc2c7b60b689447c48abb9190bf8",
"type": "github" "type": "github"
}, },
"original": { "original": {

1
rustfmt.toml Normal file
View File

@@ -0,0 +1 @@
style_edition = "2024"

View File

@@ -1,8 +1,8 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct Channels; pub struct Channels;

View File

@@ -1,8 +1,8 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct ReadMessages; pub struct ReadMessages;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct Protocol; pub struct Protocol;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ProtocolAll; pub struct ProtocolAll;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ProtocolAvailable; pub struct ProtocolAvailable;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ProtocolClear; pub struct ProtocolClear;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct ProtocolDisable; pub struct ProtocolDisable;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct ProtocolEnable; pub struct ProtocolEnable;

View File

@@ -30,7 +30,7 @@ impl Command for TagTypes {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"tagtype", "Binary", "tagtype", "Binary",
)) ));
} }
}; };

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct TagTypesAll; pub struct TagTypesAll;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct TagTypesAvailable; pub struct TagTypesAvailable;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct TagTypesClear; pub struct TagTypesClear;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct TagTypesDisable; pub struct TagTypesDisable;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct TagTypesEnable; pub struct TagTypesEnable;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct TagTypesReset; pub struct TagTypesReset;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ListMounts; pub struct ListMounts;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct ListNeighbors; pub struct ListNeighbors;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Mount; pub struct Mount;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Unmount; pub struct Unmount;

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, get_property, Command, Request, RequestParserError, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
RequestParserResult, ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property, get_property,
}, },
common::Offset, common::Offset,
}; };

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property,
}, },
filter::parse_filter, filter::parse_filter,
}; };

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property,
}; };
pub struct GetFingerprint; pub struct GetFingerprint;

View File

@@ -1,7 +1,7 @@
use crate::{ use crate::{
commands::{ commands::{
expect_property_type, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, expect_property_type,
}, },
filter::parse_filter, filter::parse_filter,
}; };

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, get_optional_property, get_property, Command, Request, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property, get_optional_property, get_property,
}, },
common::Offset, common::Offset,
}; };

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, get_and_parse_property,
}; };
pub struct Rescan; pub struct Rescan;

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property,
}, },
filter::parse_filter, filter::parse_filter,
}; };

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, get_and_parse_property,
}; };
pub struct Update; pub struct Update;

View File

@@ -1,6 +1,6 @@
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct ListPartitions; pub struct ListPartitions;

View File

@@ -2,8 +2,8 @@ use std::collections::HashMap;
use crate::{ use crate::{
commands::{ commands::{
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, get_and_parse_property,
}, },
common::VolumeValue, common::VolumeValue,
}; };

View File

@@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};
use crate::{ use crate::{
commands::{ commands::{
get_property, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, get_property,
}, },
common::ReplayGainModeMode, common::ReplayGainModeMode,
}; };

View File

@@ -3,8 +3,8 @@ use std::collections::HashMap;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::commands::{ use crate::commands::{
get_and_parse_optional_property, get_and_parse_property, Command, Request, RequestParserResult, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseAttributes, ResponseParserError, get_and_parse_optional_property, get_and_parse_property,
}; };
pub struct Stats; pub struct Stats;

View File

@@ -6,9 +6,9 @@ use serde::{Deserialize, Serialize};
use crate::common::{Audio, BoolOrOneshot, SongId, SongPosition}; use crate::common::{Audio, BoolOrOneshot, SongId, SongPosition};
use crate::commands::{ use crate::commands::{
get_and_parse_optional_property, get_and_parse_property, get_optional_property, get_property,
Command, GenericResponseValue, Request, RequestParserResult, ResponseAttributes, 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)] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]

View File

@@ -1,7 +1,7 @@
use crate::{ use crate::{
commands::{ commands::{
get_next_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_next_and_parse_property,
}, },
common::{SongId, SongPosition}, common::{SongId, SongPosition},
}; };

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct AddTagId; pub struct AddTagId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct ClearTagId; pub struct ClearTagId;

View File

@@ -1,11 +1,11 @@
use std::str::FromStr; use std::str::FromStr;
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
common::OneOrRange, common::OneOrRange,
Request,
}; };
pub struct Delete; pub struct Delete;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct DeleteId; pub struct DeleteId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Move; pub struct Move;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct MoveId; pub struct MoveId;

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
Request, Request,
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
}; };
pub struct Playlist; pub struct Playlist;

View File

@@ -1,9 +1,9 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
filter::parse_filter, filter::parse_filter,
Request,
}; };
pub struct PlaylistFind; pub struct PlaylistFind;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PlaylistId; pub struct PlaylistId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PlaylistInfo; pub struct PlaylistInfo;

View File

@@ -1,9 +1,9 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
filter::parse_filter, filter::parse_filter,
Request,
}; };
pub struct PlaylistSearch; pub struct PlaylistSearch;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PlChanges; pub struct PlChanges;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PlChangesPosId; pub struct PlChangesPosId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Prio; pub struct Prio;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct PrioId; pub struct PrioId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct RangeId; pub struct RangeId;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Shuffle; pub struct Shuffle;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct Swap; pub struct Swap;

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
Request,
commands::{ commands::{
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError, Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
}, },
Request,
}; };
pub struct SwapId; pub struct SwapId;

View File

@@ -30,7 +30,7 @@ impl Command for Commands {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"handler", "Binary", "handler", "Binary",
)) ));
} }
}; };
result.push(value.to_string()); result.push(value.to_string());

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, get_property, Command, Request, RequestParserResult, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseAttributes, ResponseParserError, get_and_parse_property, get_property,
}; };
pub struct Config; pub struct Config;

View File

@@ -30,7 +30,7 @@ impl Command for NotCommands {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"handler", "Binary", "handler", "Binary",
)) ));
} }
}; };
result.push(value.to_string()); result.push(value.to_string());

View File

@@ -30,7 +30,7 @@ impl Command for UrlHandlers {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"handler", "Binary", "handler", "Binary",
)) ));
} }
}; };
url_handlers.push(value.to_string()); url_handlers.push(value.to_string());

View File

@@ -87,7 +87,7 @@ impl Command for StickerFind {
let uri = match uri.1 { let uri = match uri.1 {
GenericResponseValue::Text(s) => s.to_string(), GenericResponseValue::Text(s) => s.to_string(),
GenericResponseValue::Binary(_) => { 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(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"sticker", "Binary", "sticker", "Binary",
)) ));
} }
}; };

View File

@@ -1,6 +1,6 @@
use crate::commands::{ use crate::commands::{
get_next_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_next_property,
}; };
pub struct StickerGet; pub struct StickerGet;

View File

@@ -1,6 +1,6 @@
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct StickerNames; pub struct StickerNames;

View File

@@ -39,7 +39,7 @@ impl Command for StickerNamesTypes {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"name", "Binary", "name", "Binary",
)) ));
} }
}; };
@@ -48,7 +48,7 @@ impl Command for StickerNamesTypes {
GenericResponseValue::Binary(_) => { GenericResponseValue::Binary(_) => {
return Err(ResponseParserError::UnexpectedPropertyType( return Err(ResponseParserError::UnexpectedPropertyType(
"type", "Binary", "type", "Binary",
)) ));
} }
}; };

View File

@@ -1,6 +1,6 @@
use crate::commands::{ use crate::commands::{
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes, Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
ResponseParserError, expect_property_type,
}; };
pub struct StickerTypes; pub struct StickerTypes;

View File

@@ -1,8 +1,8 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::commands::{ use crate::commands::{
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult, Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
ResponseAttributes, ResponseParserError, ResponseParserError, get_and_parse_property,
}; };
pub struct PlaylistLength; pub struct PlaylistLength;

View File

@@ -239,7 +239,7 @@ impl Request {
.ok_or(RequestParserError::MissingCommandListEnd(i))?; .ok_or(RequestParserError::MissingCommandListEnd(i))?;
match line.trim() { match line.trim() {
"command_list_begin" => { "command_list_begin" => {
return Err(RequestParserError::NestedCommandList(i)) return Err(RequestParserError::NestedCommandList(i));
} }
"command_list_end" => { "command_list_end" => {
return Ok((Request::CommandList(commands), rest)); return Ok((Request::CommandList(commands), rest));

View File

@@ -1,4 +1,4 @@
use crate::{common::SubSystem, Request, Response}; use crate::{Request, Response, common::SubSystem};
pub trait MPDServer { pub trait MPDServer {
type Error; type Error;