Fix clippy warnings

This commit is contained in:
Valentin Tolmer
2021-06-23 10:57:34 +02:00
parent eec0903052
commit 2f7019433d
11 changed files with 34 additions and 35 deletions

View File

@@ -46,7 +46,7 @@ where
R: serde::ser::Serialize,
{
fn from(request: &'a R) -> Self {
Self(Json(&request))
Self(Json(request))
}
}
@@ -92,7 +92,7 @@ impl HostService {
pub fn login_start(
request: login::ClientLoginStartRequest,
callback: Callback<Result<login::ServerLoginStartResponse>>,
callback: Callback<Result<Box<login::ServerLoginStartResponse>>>,
) -> Result<FetchTask> {
call_server(
"/auth/opaque/login/start",

View File

@@ -23,7 +23,7 @@ pub struct Props {
pub enum Msg {
Submit,
AuthenticationStartResponse(Result<login::ServerLoginStartResponse>),
AuthenticationStartResponse(Result<Box<login::ServerLoginStartResponse>>),
AuthenticationFinishResponse(Result<String>),
}
@@ -57,9 +57,9 @@ impl LoginForm {
match msg {
Msg::Submit => {
let username = get_form_field("username")
.ok_or(anyhow!("Could not get username from form"))?;
.ok_or_else(|| anyhow!("Could not get username from form"))?;
let password = get_form_field("password")
.ok_or(anyhow!("Could not get password from form"))?;
.ok_or_else(|| anyhow!("Could not get password from form"))?;
let mut rng = rand::rngs::OsRng;
let login_start_request =
opaque::client::login::start_login(&password, &mut rng)