cargo clippy --fix

rust
Elnu 1 year ago
parent 427b019a49
commit b20fa28198

@ -96,7 +96,7 @@ impl Database {
println!("Adding archived data for user {id}");
}
let (name, discriminator) = {
let mut iter = legacy.username.split("#");
let mut iter = legacy.username.split('#');
let name = iter.next().unwrap().to_owned();
let discriminator = iter
.next()
@ -118,7 +118,7 @@ impl Database {
// their username/discriminator since their previous submission
archive();
} else {
match User::fetch(&http, submission.author_id).await {
match User::fetch(http, submission.author_id).await {
Ok(user) => {
self.conn.execute(
"INSERT INTO User(id, name, discriminator, avatar) VALUES (?1, ?2, ?3, ?4)",

@ -30,10 +30,9 @@ impl LegacySubmission {
// it's a datestamp.
(|| image
// Get filename without extension
.split(".")
.nth(0)?
.split('.').next()?
// Get last number
.split("-")
.split('-')
.last()?
.parse()
.ok()

@ -17,7 +17,7 @@ pub struct Login<'r> {
#[post("/login", data = "<login>")]
pub async fn post_login(login: Form<Login<'_>>, cookies: &CookieJar<'_>) -> Redirect {
if (login.token_type != "Bearer" || login.scope.split("+").any(|scope| scope == "identify"))
if (login.token_type != "Bearer" || login.scope.split('+').any(|scope| scope == "identify"))
&& SessionUser::init(login.access_token, cookies).await.is_ok()
{
cookies.add(Cookie::new(

Loading…
Cancel
Save