Rust edition 2024
This commit is contained in:
@@ -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"] }
|
||||
|
12
flake.lock
generated
12
flake.lock
generated
@@ -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": {
|
||||
|
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
@@ -0,0 +1 @@
|
||||
style_edition = "2024"
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct Protocol;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct ProtocolAll;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct ProtocolAvailable;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct ProtocolClear;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ProtocolDisable;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ProtocolEnable;
|
||||
|
@@ -30,7 +30,7 @@ impl Command for TagTypes {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"tagtype", "Binary",
|
||||
))
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct TagTypesAll;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct TagTypesAvailable;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct TagTypesClear;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesDisable;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesEnable;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesReset;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct ListMounts;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct ListNeighbors;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Mount;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Unmount;
|
||||
|
@@ -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,
|
||||
};
|
||||
|
@@ -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,
|
||||
};
|
||||
|
@@ -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;
|
||||
|
@@ -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,
|
||||
};
|
||||
|
@@ -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,
|
||||
};
|
||||
|
@@ -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;
|
||||
|
@@ -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,
|
||||
};
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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,
|
||||
};
|
||||
|
@@ -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,
|
||||
};
|
||||
|
@@ -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;
|
||||
|
@@ -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)]
|
||||
|
@@ -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},
|
||||
};
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct AddTagId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ClearTagId;
|
||||
|
@@ -1,11 +1,11 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
common::OneOrRange,
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Delete;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct DeleteId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Move;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct MoveId;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
};
|
||||
|
||||
pub struct Playlist;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
filter::parse_filter,
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlaylistFind;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlaylistId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlaylistInfo;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
filter::parse_filter,
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlaylistSearch;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlChanges;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlChangesPosId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Prio;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PrioId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct RangeId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Shuffle;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Swap;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct SwapId;
|
||||
|
@@ -30,7 +30,7 @@ impl Command for Commands {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"handler", "Binary",
|
||||
))
|
||||
));
|
||||
}
|
||||
};
|
||||
result.push(value.to_string());
|
||||
|
@@ -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;
|
||||
|
@@ -30,7 +30,7 @@ impl Command for NotCommands {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"handler", "Binary",
|
||||
))
|
||||
));
|
||||
}
|
||||
};
|
||||
result.push(value.to_string());
|
||||
|
@@ -30,7 +30,7 @@ impl Command for UrlHandlers {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"handler", "Binary",
|
||||
))
|
||||
));
|
||||
}
|
||||
};
|
||||
url_handlers.push(value.to_string());
|
||||
|
@@ -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",
|
||||
))
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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",
|
||||
))
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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));
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use crate::{common::SubSystem, Request, Response};
|
||||
use crate::{Request, Response, common::SubSystem};
|
||||
|
||||
pub trait MPDServer {
|
||||
type Error;
|
||||
|
Reference in New Issue
Block a user