cargo clippy

This commit is contained in:
Pierre HUBERT 2022-04-19 11:03:10 +02:00
parent 65b5c812b1
commit b5a2f1abcb
2 changed files with 4 additions and 4 deletions

View File

@ -55,6 +55,6 @@ impl AppConfig {
}
pub fn domain_name(&self) -> &str {
self.website_origin.split('/').skip(2).next().unwrap_or(APP_NAME)
self.website_origin.split('/').nth(2).unwrap_or(APP_NAME)
}
}

View File

@ -38,10 +38,10 @@ impl TotpKey {
pub fn url_for_user(&self, u: &User, conf: &AppConfig) -> String {
format!(
"otpauth://totp/{}:{}?secret={}&issuer={}&algorithm=SHA1&digits={}&period={}",
urlencoding::encode(&conf.domain_name()),
urlencoding::encode(conf.domain_name()),
urlencoding::encode(&u.username),
self.encoded,
urlencoding::encode(&conf.domain_name()),
urlencoding::encode(conf.domain_name()),
NUM_DIGITS,
PERIOD,
)
@ -63,7 +63,7 @@ impl TotpKey {
/// Get current code
pub fn current_code(&self) -> Res<String> {
self.get_code_at(|| time())
self.get_code_at(time)
}
/// Get previous code