mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-05 11:30:46 +00:00
client/login: clippy fixes
Signed-off-by: Max Carrara <m.carrara@proxmox.com>
This commit is contained in:
parent
68fe8baf95
commit
ede73a6561
@ -85,13 +85,13 @@ impl HttpApiResponse {
|
|||||||
match self.content_type.as_deref() {
|
match self.content_type.as_deref() {
|
||||||
Some("application/json") => Ok(()),
|
Some("application/json") => Ok(()),
|
||||||
Some(other) => {
|
Some(other) => {
|
||||||
return Err(Error::BadApi(
|
Err(Error::BadApi(
|
||||||
format!("expected json body, got {other}",),
|
format!("expected json body, got {other}",),
|
||||||
None,
|
None,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
return Err(Error::BadApi(
|
Err(Error::BadApi(
|
||||||
"expected json body, but no Content-Type was sent".to_string(),
|
"expected json body, but no Content-Type was sent".to_string(),
|
||||||
None,
|
None,
|
||||||
))
|
))
|
||||||
|
@ -71,7 +71,7 @@ mod bytes_as_base64url_nopad {
|
|||||||
pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result<Vec<u8>, D::Error> {
|
pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result<Vec<u8>, D::Error> {
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
String::deserialize(deserializer).and_then(|string| {
|
String::deserialize(deserializer).and_then(|string| {
|
||||||
base64::decode_config(&string, base64::URL_SAFE_NO_PAD)
|
base64::decode_config(string, base64::URL_SAFE_NO_PAD)
|
||||||
.map_err(|err| Error::custom(err.to_string()))
|
.map_err(|err| Error::custom(err.to_string()))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user