[niepce] rust: run cargo fmt
- From: Hubert Figuière <hub src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [niepce] rust: run cargo fmt
- Date: Sat, 13 Oct 2018 17:45:31 +0000 (UTC)
commit 2fa1a3947da560a82ba816da97eb36128a565865
Author: Hubert Figuière <hub figuiere net>
Date: Sun Oct 7 13:47:43 2018 -0400
rust: run cargo fmt
build.rs | 4 +++-
src/engine/db/library.rs | 36 ++++++++++++++++--------------------
src/lib.rs | 2 +-
3 files changed, 20 insertions(+), 22 deletions(-)
---
diff --git a/build.rs b/build.rs
index 9c2bb29..47d54ee 100644
--- a/build.rs
+++ b/build.rs
@@ -40,7 +40,9 @@ fn main() {
builder = builder.clang_arg(include);
}
- builder.dump_preprocessed_input().expect("Unable to dump preprocessed input");
+ builder
+ .dump_preprocessed_input()
+ .expect("Unable to dump preprocessed input");
// Finish the builder and generate the bindings.
let bindings = builder
.rustfmt_bindings(true)
diff --git a/src/engine/db/library.rs b/src/engine/db/library.rs
index 3e851a6..fcc07f2 100644
--- a/src/engine/db/library.rs
+++ b/src/engine/db/library.rs
@@ -17,24 +17,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-use std::path::{Path, PathBuf};
use std::fs::File;
use std::io::Write;
+use std::path::{Path, PathBuf};
use chrono::Utc;
use rusqlite;
use super::{FromDb, LibraryId};
+use engine::db::filebundle::{FileBundle, Sidecar};
+use engine::db::keyword::Keyword;
use engine::db::label::Label;
-use engine::db::libfolder;
-use engine::db::libfolder::LibFolder;
use engine::db::libfile;
use engine::db::libfile::LibFile;
+use engine::db::libfolder;
+use engine::db::libfolder::LibFolder;
use engine::db::libmetadata::LibMetadata;
-use engine::db::filebundle::{FileBundle, Sidecar};
-use engine::db::keyword::Keyword;
-use engine::library::notification::Notification as LibNotification;
use engine::library::notification::engine_library_notify;
+use engine::library::notification::Notification as LibNotification;
use fwk;
use fwk::PropertyValue;
use root::eng::NiepceProperties as Np;
@@ -390,23 +390,20 @@ impl Library {
/// Return the LibFolder or None
pub fn get_folder(&self, path: &str) -> Option<LibFolder> {
let conn = try_opt!(self.dbconn.as_ref());
- let sql = format!("SELECT {} FROM {} WHERE path=:1",
- LibFolder::read_db_columns(),
- LibFolder::read_db_tables()
- );
+ let sql = format!(
+ "SELECT {} FROM {} WHERE path=:1",
+ LibFolder::read_db_columns(),
+ LibFolder::read_db_tables()
+ );
let mut stmt = try_opt!(conn.prepare(&sql).ok());
let mut rows = try_opt!(stmt.query(&[&path]).ok());
match rows.next() {
- None => {
- None
- },
+ None => None,
Some(Err(err)) => {
err_out!("Error {:?}", err);
None
- },
- Some(Ok(row)) => {
- Some(LibFolder::read_from(&row))
}
+ Some(Ok(row)) => Some(LibFolder::read_from(&row)),
}
}
@@ -648,8 +645,7 @@ impl Library {
}
let keyword_id = conn.last_insert_rowid();
self.notify(Box::new(LibNotification::AddedKeyword(Keyword::new(
- keyword_id,
- keyword,
+ keyword_id, keyword,
))));
return keyword_id;
}
@@ -996,10 +992,10 @@ impl Library {
#[cfg(test)]
mod test {
+ use engine::db::filebundle::FileBundle;
+ use std::fs;
use std::path::Path;
use std::path::PathBuf;
- use std::fs;
- use engine::db::filebundle::FileBundle;
struct AutoDelete {
path: PathBuf,
diff --git a/src/lib.rs b/src/lib.rs
index 051131c..8a2ee94 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -33,9 +33,9 @@ extern crate try_opt;
#[macro_use]
pub mod fwk;
+pub mod capi;
pub mod engine;
pub mod libraryclient;
-pub mod capi;
pub mod niepce;
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]