fix according to cargo clippy

feat/vaults
Tomáš Mládek 2020-08-30 22:14:24 +02:00
parent 6b32235896
commit 7faa12a44f
3 changed files with 4 additions and 9 deletions

View File

@ -85,7 +85,7 @@ pub async fn update_directory_bg(
hasher_worker: Addr<HasherWorker>,
) {
let result = update_directory(directory, &db_executor, &hasher_worker).await;
if !result.is_ok() {
if result.is_err() {
warn!("Update did not succeed!");
}
}

View File

@ -12,7 +12,6 @@ use std::env;
use std::fs;
use std::net::SocketAddr;
use std::path::PathBuf;
use webbrowser;
mod database;
mod dataops;
@ -84,17 +83,13 @@ fn main() -> std::io::Result<()> {
if open_result.new {
info!("The vault has been just created, running initial update...");
actix::spawn(dataops::update_directory_bg(
vault_path.clone(),
db_addr.clone(),
hash_addr.clone(),
));
actix::spawn(dataops::update_directory_bg(vault_path, db_addr, hash_addr));
}
// TODO REMOVE
if !matches.is_present("NO_BROWSER") && false {
let ui_result = webbrowser::open(&format!("http://localhost:{}", bind.port()));
if !ui_result.is_ok() {
if ui_result.is_err() {
warn!("Could not open UI in browser!");
}
}

View File

@ -44,7 +44,7 @@ pub async fn get_lookup(
.send(crate::database::LookupByFilename { query: info.query })
.await?;
Ok(HttpResponse::Ok().json(response.map_err(|e| error::ErrorInternalServerError(e))?))
Ok(HttpResponse::Ok().json(response.map_err(error::ErrorInternalServerError)?))
}
#[post("/api/refresh")]