Merge pull request #1019 from matthiasbeyer/fix-warnings

Fix warnings by not allowing them anymore
This commit is contained in:
Matthias Beyer 2017-08-27 21:14:00 +02:00 committed by GitHub
commit b2d6a881b0
25 changed files with 132 additions and 18 deletions

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -17,6 +17,22 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
trivial_numeric_casts,
unstable_features,
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,
)]
#[macro_use] extern crate log;
extern crate email;
extern crate semver;

View file

@ -53,6 +53,7 @@ impl<'a> Mail<'a> {
/// Imports a mail from the Path passed
pub fn import_from_path<P: AsRef<Path>>(store: &Store, p: P) -> Result<Mail> {
debug!("Importing Mail from path");
let h = MailHasher::new();
let f = RefFlags::default().with_content_hashing(true).with_permission_tracking(false);
let p = PathBuf::from(p.as_ref());
@ -60,6 +61,7 @@ impl<'a> Mail<'a> {
Ref::create_with_hasher(store, p, f, h)
.map_err_into(MEK::RefCreationError)
.and_then(|reference| {
debug!("Build reference file: {:?}", reference);
reference.fs_file()
.map_err_into(MEK::RefHandlingError)
.and_then(|path| File::open(path).map_err_into(MEK::IOError))
@ -76,6 +78,7 @@ impl<'a> Mail<'a> {
/// Opens a mail by the passed hash
pub fn open<S: AsRef<str>>(store: &Store, hash: S) -> Result<Option<Mail>> {
debug!("Opening Mail by Hash");
Ref::get_by_hash(store, String::from(hash.as_ref()))
.map_err_into(MEK::FetchByHashError)
.map_err_into(MEK::FetchError)
@ -88,6 +91,7 @@ impl<'a> Mail<'a> {
/// Implement me as TryFrom as soon as it is stable
pub fn from_ref(r: Ref<'a>) -> Result<Mail> {
debug!("Building Mail object from Ref: {:?}", r);
r.fs_file()
.map_err_into(MEK::RefHandlingError)
.and_then(|path| File::open(path).map_err_into(MEK::IOError))
@ -102,6 +106,7 @@ impl<'a> Mail<'a> {
}
pub fn get_field(&self, field: &str) -> Result<Option<String>> {
debug!("Getting field in mail: {:?}", field);
self.1
.parsed()
.map_err_into(MEK::MailParsingError)

View file

@ -17,10 +17,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
use result::Result;
use chrono::NaiveDateTime;
use filters::filter::Filter;
use libimagstore::store::FileLockEntry;

View file

@ -30,10 +30,7 @@ mod test {
use libimagstore::store::Store;
use super::create::*;
use super::get::*;
use super::setendtime::*;
use super::storeid::*;
use super::tag::*;
fn get_store() -> Store {
@ -53,7 +50,7 @@ mod test {
let iter = tags.into_iter().map(String::from);
let iter : SetEndTimeIter = TagIter::new(Box::new(iter))
let _ : SetEndTimeIter = TagIter::new(Box::new(iter))
.create_storeids(now)
.create_entries(&store)
.set_end_time(then);

View file

@ -17,6 +17,22 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
trivial_numeric_casts,
unstable_features,
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,
)]
extern crate filters;
extern crate chrono;
extern crate toml;

View file

@ -22,7 +22,8 @@ generate_error_module!(
ConversionError => "Conversion Error",
StoreError => "Store Error",
StoreIdError => "Store Id handling error",
ImportError => "Error importing"
ImportError => "Error importing",
UTF8Error => "Encountered non-UTF8 characters while reading input"
);
);

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -48,7 +48,7 @@ impl<'a> Task<'a> {
pub fn import<R: BufRead>(store: &'a Store, mut r: R) -> Result<(Task<'a>, String, Uuid)> {
let mut line = String::new();
r.read_line(&mut line);
try!(r.read_line(&mut line).map_err_into(TEK::UTF8Error));
import_task(&line.as_str())
.map_err_into(TEK::ImportError)
.and_then(|t| {
@ -70,7 +70,7 @@ impl<'a> Task<'a> {
where R: BufRead
{
let mut line = String::new();
r.read_line(&mut line);
try!(r.read_line(&mut line).map_err_into(TEK::UTF8Error));
Task::get_from_string(store, line)
}
@ -104,7 +104,7 @@ impl<'a> Task<'a> {
/// implicitely create the task if it does not exist.
pub fn retrieve_from_import<R: BufRead>(store: &'a Store, mut r: R) -> Result<Task<'a>> {
let mut line = String::new();
r.read_line(&mut line);
try!(r.read_line(&mut line).map_err_into(TEK::UTF8Error));
Task::retrieve_from_string(store, line)
}

View file

@ -17,11 +17,27 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
trivial_numeric_casts,
unstable_features,
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,
)]
extern crate uuid;
extern crate toml;
#[macro_use] extern crate libimagerror;
#[macro_use] extern crate libimagstore;
extern crate libimagstore;
extern crate libimagentrylink;
extern crate libimagnotes;
extern crate libimagutil;

View file

@ -17,6 +17,22 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
trivial_numeric_casts,
unstable_features,
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,
)]
extern crate toml_query;
extern crate toml;
#[macro_use]

View file

@ -23,6 +23,3 @@ libimagerror = { version = "0.4.0", path = "../../../lib/core/libimagerror" }
libimagstore = { version = "0.4.0", path = "../../../lib/core/libimagstore" }
libimagutil = { version = "0.4.0", path = "../../../lib/etc/libimagutil" }
[dev-dependencies]
is-match = "0.1"

View file

@ -17,6 +17,22 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
trivial_numeric_casts,
unstable_features,
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,
)]
#[macro_use] extern crate lazy_static;
extern crate chrono;
extern crate toml_query;
@ -26,9 +42,6 @@ extern crate toml;
extern crate libimagstore;
extern crate libimagutil;
#[cfg(test)]
#[macro_use] extern crate is_match;
pub mod datepath;
pub mod datetime;
pub mod error;

View file

@ -17,6 +17,22 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
trivial_numeric_casts,
unstable_features,
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,
)]
#[macro_use] extern crate libimagerror;
extern crate libimagstore;
extern crate libimagrt;

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,
@ -26,6 +27,7 @@
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
unused_qualifications,
while_true,

View file

@ -18,6 +18,7 @@
//
#![deny(
dead_code,
non_camel_case_types,
non_snake_case,
path_statements,