mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2026-02-04 15:51:23 +01:00
fix lints for upcoming 1.88.0 toolchain
This commit is contained in:
parent
fa6fb37a2c
commit
595f35b673
19 changed files with 41 additions and 42 deletions
|
|
@ -198,7 +198,7 @@ pub(crate) async fn register_route(
|
|||
&uiaainfo,
|
||||
)?;
|
||||
if !worked {
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
}
|
||||
// Success!
|
||||
} else if let Some(json) = body.json_body {
|
||||
|
|
@ -213,7 +213,7 @@ pub(crate) async fn register_route(
|
|||
&uiaainfo,
|
||||
&json,
|
||||
)?;
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
} else {
|
||||
return Err(Error::BadRequest(ErrorKind::NotJson, "Not json."));
|
||||
}
|
||||
|
|
@ -346,13 +346,13 @@ pub(crate) async fn change_password_route(
|
|||
&uiaainfo,
|
||||
)?;
|
||||
if !worked {
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
}
|
||||
// Success!
|
||||
} else if let Some(json) = body.json_body {
|
||||
uiaainfo.session = Some(utils::random_string(SESSION_ID_LENGTH));
|
||||
services().uiaa.create(sender_user, sender_device, &uiaainfo, &json)?;
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
} else {
|
||||
return Err(Error::BadRequest(ErrorKind::NotJson, "Not json."));
|
||||
}
|
||||
|
|
@ -434,13 +434,13 @@ pub(crate) async fn deactivate_route(
|
|||
&uiaainfo,
|
||||
)?;
|
||||
if !worked {
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
}
|
||||
// Success!
|
||||
} else if let Some(json) = body.json_body {
|
||||
uiaainfo.session = Some(utils::random_string(SESSION_ID_LENGTH));
|
||||
services().uiaa.create(sender_user, sender_device, &uiaainfo, &json)?;
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
} else {
|
||||
return Err(Error::BadRequest(ErrorKind::NotJson, "Not json."));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ pub(crate) async fn get_alias_helper(
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let Some(room_id) = room_id else {
|
||||
return Err(Error::BadRequest(
|
||||
|
|
|
|||
|
|
@ -107,13 +107,13 @@ pub(crate) async fn delete_device_route(
|
|||
&uiaainfo,
|
||||
)?;
|
||||
if !worked {
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
}
|
||||
// Success!
|
||||
} else if let Some(json) = body.json_body {
|
||||
uiaainfo.session = Some(utils::random_string(SESSION_ID_LENGTH));
|
||||
services().uiaa.create(sender_user, sender_device, &uiaainfo, &json)?;
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
} else {
|
||||
return Err(Error::BadRequest(ErrorKind::NotJson, "Not json."));
|
||||
}
|
||||
|
|
@ -161,13 +161,13 @@ pub(crate) async fn delete_devices_route(
|
|||
&uiaainfo,
|
||||
)?;
|
||||
if !worked {
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
}
|
||||
// Success!
|
||||
} else if let Some(json) = body.json_body {
|
||||
uiaainfo.session = Some(utils::random_string(SESSION_ID_LENGTH));
|
||||
services().uiaa.create(sender_user, sender_device, &uiaainfo, &json)?;
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
} else {
|
||||
return Err(Error::BadRequest(ErrorKind::NotJson, "Not json."));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,13 +135,13 @@ pub(crate) async fn upload_signing_keys_route(
|
|||
&uiaainfo,
|
||||
)?;
|
||||
if !worked {
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
}
|
||||
// Success!
|
||||
} else if let Some(json) = body.json_body {
|
||||
uiaainfo.session = Some(utils::random_string(SESSION_ID_LENGTH));
|
||||
services().uiaa.create(sender_user, sender_device, &uiaainfo, &json)?;
|
||||
return Err(Error::Uiaa(uiaainfo));
|
||||
return Err(Error::Uiaa(Box::new(uiaainfo)));
|
||||
} else {
|
||||
return Err(Error::BadRequest(ErrorKind::NotJson, "Not json."));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,14 +26,14 @@ pub(crate) async fn report_event_route(
|
|||
ErrorKind::InvalidParam,
|
||||
"Invalid score, must be within 0 to -100",
|
||||
));
|
||||
};
|
||||
}
|
||||
|
||||
if let Some(true) = body.reason.clone().map(|s| s.chars().count() > 250) {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::InvalidParam,
|
||||
"Reason too long, should be 250 characters or fewer",
|
||||
));
|
||||
};
|
||||
}
|
||||
|
||||
services().admin.send_message(message::RoomMessageEventContent::text_html(
|
||||
format!(
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ async fn ar_from_request_inner(
|
|||
|
||||
if let Some(json_body) = &json_body {
|
||||
request_map.insert("content".to_owned(), json_body.clone());
|
||||
};
|
||||
}
|
||||
|
||||
let keys_result = services()
|
||||
.rooms
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ where
|
|||
serde_json::from_slice(http_request.body())
|
||||
.expect("body is valid json, we just created it"),
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
request_map
|
||||
.insert("method".to_owned(), T::METADATA.method.to_string().into());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue