Run cargo fmt.

This commit is contained in:
Paul Makles
2021-01-18 20:26:26 +00:00
parent bd789b6825
commit a1a921bbcb
19 changed files with 141 additions and 142 deletions

View File

@@ -6,38 +6,24 @@ use crate::database::Ref;
#[get("/<target>/avatar")]
pub async fn req(target: Ref) -> Option<NamedFile> {
match target.id.chars().nth(25).unwrap() {
'0' |
'1' |
'2' |
'3' |
'4' |
'5' |
'6' |
'7' => NamedFile::open(Path::new("assets/user_red.png")).await.ok(),
'8' |
'9' |
'A' |
'C' |
'B' |
'D' |
'E' |
'F' => NamedFile::open(Path::new("assets/user_green.png")).await.ok(),
'G' |
'H' |
'J' |
'K' |
'M' |
'N' |
'P' |
'Q' => NamedFile::open(Path::new("assets/user_blue.png")).await.ok(),
'R' |
'S' |
'T' |
'V' |
'W' |
'X' |
'Y' |
'Z' => NamedFile::open(Path::new("assets/user_yellow.png")).await.ok(),
_ => unreachable!()
'0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' => {
NamedFile::open(Path::new("assets/user_red.png")).await.ok()
}
'8' | '9' | 'A' | 'C' | 'B' | 'D' | 'E' | 'F' => {
NamedFile::open(Path::new("assets/user_green.png"))
.await
.ok()
}
'G' | 'H' | 'J' | 'K' | 'M' | 'N' | 'P' | 'Q' => {
NamedFile::open(Path::new("assets/user_blue.png"))
.await
.ok()
}
'R' | 'S' | 'T' | 'V' | 'W' | 'X' | 'Y' | 'Z' => {
NamedFile::open(Path::new("assets/user_yellow.png"))
.await
.ok()
}
_ => unreachable!(),
}
}