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

@@ -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;

View File

@@ -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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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,
};

View File

@@ -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,
};

View File

@@ -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;

View File

@@ -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,
};

View File

@@ -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,
};

View File

@@ -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;

View File

@@ -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,
};

View File

@@ -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;

View File

@@ -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;

View File

@@ -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,
};

View File

@@ -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,
};

View File

@@ -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;

View File

@@ -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)]

View File

@@ -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},
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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;

View File

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

View File

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

View File

@@ -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",
))
));
}
};

View File

@@ -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;

View File

@@ -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;

View File

@@ -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",
))
));
}
};

View File

@@ -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;

View File

@@ -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;

View File

@@ -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));

View File

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