From 24c6fcb4f4a2fe5217a8f89f8321ca0dc745a2bb Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Fri, 3 Nov 2017 12:29:10 -0700 Subject: [PATCH] Formatting --- src/api.rs | 2 +- src/index.rs | 10 +++++----- src/main.rs | 5 ++++- src/user.rs | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/api.rs b/src/api.rs index b09ed01..8ec1156 100644 --- a/src/api.rs +++ b/src/api.rs @@ -112,7 +112,7 @@ fn get_endpoints(db: Arc, index_channel: Arc>>) auth_api_mount.mount("/recent/", move |request: &mut Request| self::recent(request, db.deref())); } - { + { let db = db.clone(); auth_api_mount.mount("/search/", move |request: &mut Request| self::search(request, db.deref())); diff --git a/src/index.rs b/src/index.rs index 377c2b0..030ec45 100644 --- a/src/index.rs +++ b/src/index.rs @@ -382,7 +382,7 @@ pub fn update(db: &T) -> Result<()> clean(db)?; populate(db)?; info!("Library index update took {} seconds", - start.elapsed().as_secs()); + start.elapsed().as_secs()); Ok(()) } @@ -579,12 +579,12 @@ pub fn get_recent_albums(db: &T, count: i64) -> Result> pub fn search(db: &T, query: &str) -> Result> where T: ConnectionSource + VFSSource { - Ok(vec![]) - // Find dirs with matching path and parent not matching + Ok(vec![]) + // Find dirs with matching path and parent not matching - // Find songs with matching title/album/artist - // Remove songs within a matched directory + // Find songs with matching title/album/artist + // Remove songs within a matched directory } #[test] diff --git a/src/main.rs b/src/main.rs index d307e1c..0547c61 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,7 +115,10 @@ fn run() -> Result<()> { options.optopt("p", "port", "set polaris to run on a custom port", "PORT"); options.optopt("d", "database", "set the path to index database", "FILE"); options.optopt("w", "web", "set the path to web client files", "DIRECTORY"); - options.optopt("l", "log", "set the log level to a value between 0 (off) and 3 (debug)", "LEVEL"); + options.optopt("l", + "log", + "set the log level to a value between 0 (off) and 3 (debug)", + "LEVEL"); #[cfg(unix)] options.optflag("f", diff --git a/src/user.rs b/src/user.rs index 2a12fbd..237791e 100644 --- a/src/user.rs +++ b/src/user.rs @@ -76,7 +76,7 @@ pub fn count(db: &T) -> Result use db::users::dsl::*; let connection = db.get_connection(); let count = users.count().get_result(connection.deref())?; - Ok(count) + Ok(count) } pub fn is_admin(db: &T, username: &str) -> Result