1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Enable the clippy::str_to_string lint

This commit is contained in:
Quentin Gliech
2022-08-05 10:18:32 +02:00
parent 78fe152d9b
commit c1ed726dc8
39 changed files with 120 additions and 81 deletions

View File

@ -13,7 +13,7 @@
// limitations under the License.
#![forbid(unsafe_code)]
#![deny(clippy::all, rustdoc::broken_intra_doc_links)]
#![deny(clippy::all, clippy::str_to_string, rustdoc::broken_intra_doc_links)]
#![warn(clippy::pedantic)]
#![allow(
clippy::module_name_repetitions,

View File

@ -153,7 +153,7 @@ impl TokenType {
let token_type =
TokenType::match_prefix(prefix).ok_or_else(|| TokenFormatError::UnknownPrefix {
prefix: prefix.to_string(),
prefix: prefix.to_owned(),
})?;
let base = format!("{}_{}", token_type.prefix(), random_part);
@ -162,7 +162,7 @@ impl TokenType {
if crc != expected_crc {
return Err(TokenFormatError::InvalidCrc {
expected: expected_crc,
got: crc.to_string(),
got: crc.to_owned(),
});
}

View File

@ -34,8 +34,8 @@ where
pub fn samples() -> Vec<Self> {
vec![User {
data: Default::default(),
username: "john".to_string(),
sub: "123-456".to_string(),
username: "john".to_owned(),
sub: "123-456".to_owned(),
primary_email: None,
}]
}
@ -147,13 +147,13 @@ where
vec![
Self {
data: T::UserEmailData::default(),
email: "alice@example.com".to_string(),
email: "alice@example.com".to_owned(),
created_at: Utc::now(),
confirmed_at: Some(Utc::now()),
},
Self {
data: T::UserEmailData::default(),
email: "bob@example.com".to_string(),
email: "bob@example.com".to_owned(),
created_at: Utc::now(),
confirmed_at: None,
},
@ -209,7 +209,7 @@ where
.flat_map(|state| {
UserEmail::samples().into_iter().map(move |email| Self {
data: Default::default(),
code: "123456".to_string(),
code: "123456".to_owned(),
email,
created_at: Utc::now() - Duration::minutes(10),
state: state.clone(),