Linter changes

This commit is contained in:
Neshura 2023-12-17 20:35:37 +01:00
parent 079e9f5e11
commit 40e142ccc7
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
6 changed files with 29 additions and 56 deletions
src/lemmy

View file

@ -20,11 +20,11 @@ pub(crate) struct Credentials {
impl Credentials {
pub(crate) fn get_username(&self) -> Sensitive<String> {
return Sensitive::new(self.username.clone());
Sensitive::new(self.username.clone())
}
pub(crate) fn get_password(&self) -> Sensitive<String> {
return Sensitive::new(self.password.clone());
Sensitive::new(self.password.clone())
}
pub(crate) fn set_credentials() -> Result<Self, VarError> {
@ -63,10 +63,10 @@ pub(crate) async fn login(credentials: &Credentials, instance: &str) -> Result<L
jwt_token: token.clone(),
instance: instance.to_string(),
}),
None => Err(panic!("Login did not return JWT token. Are the credentials valid?"))
None => panic!("Login did not return JWT token. Are the credentials valid?")
}
},
status => Err(panic!("Unexpected HTTP Status '{}' during Login", status.to_string()))
status => panic!("Unexpected HTTP Status '{}' during Login", status)
}
}
@ -196,7 +196,7 @@ impl Lemmy {
communities.insert(community.name, community.id);
}
return Ok(communities)
Ok(communities)
}
}