chore: fix cargo clippy (#174)

This commit is contained in:
sigoden
2023-02-19 12:24:42 +08:00
committed by GitHub
parent fea9bf988a
commit 47883376c1
5 changed files with 26 additions and 32 deletions

View File

@@ -43,7 +43,7 @@ impl AccessControl {
}
for rule in raw_rules {
let parts: Vec<&str> = rule.split('@').collect();
let create_err = || format!("Invalid auth `{}`", rule).into();
let create_err = || format!("Invalid auth `{rule}`").into();
match parts.as_slice() {
[path, readwrite] => {
let control = PathControl {
@@ -172,7 +172,7 @@ impl Account {
let user = p[0];
let pass = p[1];
let mut h = Context::new();
h.consume(format!("{}:{}:{}", user, REALM, pass).as_bytes());
h.consume(format!("{user}:{REALM}:{pass}").as_bytes());
Some(Account {
user: user.to_owned(),
pass: format!("{:x}", h.compute()),
@@ -190,7 +190,7 @@ impl AuthMethod {
pub fn www_auth(&self, stale: bool) -> String {
match self {
AuthMethod::Basic => {
format!("Basic realm=\"{}\"", REALM)
format!("Basic realm=\"{REALM}\"")
}
AuthMethod::Digest => {
let str_stale = if stale { "stale=true," } else { "" };