Skip to content
Snippets Groups Projects
Verified Commit 8c4cebfe authored by Volkor Barbarian Warrior's avatar Volkor Barbarian Warrior
Browse files

fix: cleaning up a few clippy warnings

parent 1ccc82ca
No related branches found
No related tags found
No related merge requests found
...@@ -44,13 +44,12 @@ pub async fn list_files(req: &mut Request, res: &mut Response) { ...@@ -44,13 +44,12 @@ pub async fn list_files(req: &mut Request, res: &mut Response) {
let human_time = convert_unix_timestamp(f.expiry); let human_time = convert_unix_timestamp(f.expiry);
// If isDeleted, change colour to red, else green // If isDeleted, change colour to red, else green
let mut colour: String = String::new(); let colour = if f.is_deleted {
if f.is_deleted { "background-color: #ff00000a;".to_string()
colour = "background-color: #ff00000a;".to_string()
} else { } else {
colour = "background-color: #00ff100a;".to_string() "background-color: #00ff100a;".to_string()
} };
// Add a new file to the rendered string // Add a new file to the rendered string
html.push_str(&format!("<tr style='{}'><td><a href={}>{}</a></td><td data-sort='{}'>{}</td><td>{}</td><td>{}</td><td data-sort='{}'>{}</td></tr>", html.push_str(&format!("<tr style='{}'><td><a href={}>{}</a></td><td data-sort='{}'>{}</td><td>{}</td><td>{}</td><td data-sort='{}'>{}</td></tr>",
colour, colour,
......
...@@ -195,9 +195,7 @@ fn convert_unix_timestamp(unix_timestamp: i64) -> String { ...@@ -195,9 +195,7 @@ fn convert_unix_timestamp(unix_timestamp: i64) -> String {
Utc, Utc,
); );
let relative_date = datetime.humanize(); datetime.humanize()
relative_date.to_string()
} }
/// Calculate the number of files in the FileMetric result /// Calculate the number of files in the FileMetric result
......
...@@ -80,10 +80,10 @@ async fn main() { ...@@ -80,10 +80,10 @@ async fn main() {
let db_url = &CONFIG.database.url; let db_url = &CONFIG.database.url;
// Match on the database type // Match on the database type
match DatabaseType::from_str(&sql_backend) { match DatabaseType::from_str(sql_backend) {
Some(DatabaseType::Sqlite) => { Some(DatabaseType::Sqlite) => {
tracing::info!("Using SQLite backend"); tracing::info!("Using SQLite backend");
let pool = SqlitePool::connect(&db_url).await.unwrap(); let pool = SqlitePool::connect(db_url).await.unwrap();
SQLITE.set(pool).unwrap(); SQLITE.set(pool).unwrap();
} }
Some(DatabaseType::Postgres) => { Some(DatabaseType::Postgres) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment