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) {
let human_time = convert_unix_timestamp(f.expiry);
// If isDeleted, change colour to red, else green
let mut colour: String = String::new();
if f.is_deleted {
colour = "background-color: #ff00000a;".to_string()
let colour = if f.is_deleted {
"background-color: #ff00000a;".to_string()
} else {
colour = "background-color: #00ff100a;".to_string()
}
"background-color: #00ff100a;".to_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>",
colour,
......
......@@ -195,9 +195,7 @@ fn convert_unix_timestamp(unix_timestamp: i64) -> String {
Utc,
);
let relative_date = datetime.humanize();
relative_date.to_string()
datetime.humanize()
}
/// Calculate the number of files in the FileMetric result
......
......@@ -80,10 +80,10 @@ async fn main() {
let db_url = &CONFIG.database.url;
// Match on the database type
match DatabaseType::from_str(&sql_backend) {
match DatabaseType::from_str(sql_backend) {
Some(DatabaseType::Sqlite) => {
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();
}
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