Merge pull request #361 from matthiasbeyer/libimagrt/zero-warnings
Libimagrt/zero warnings
This commit is contained in:
commit
e040d0d0c6
3 changed files with 8 additions and 7 deletions
|
@ -17,7 +17,6 @@ pub mod error {
|
|||
*/
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum ConfigErrorKind {
|
||||
ConfigParsingFailed,
|
||||
NoConfigFileFound,
|
||||
}
|
||||
|
||||
|
@ -54,7 +53,6 @@ pub mod error {
|
|||
*/
|
||||
pub fn as_str(e: &ConfigError) -> &'static str {
|
||||
match e.kind() {
|
||||
ConfigErrorKind::ConfigParsingFailed => "Config parsing failed",
|
||||
ConfigErrorKind::NoConfigFileFound => "No config file found",
|
||||
}
|
||||
}
|
||||
|
@ -157,6 +155,7 @@ impl Configuration {
|
|||
self.editor.as_ref()
|
||||
}
|
||||
|
||||
#[allow(dead_code)] // Why do I actually need this annotation on a pub function?
|
||||
pub fn config(&self) -> &Value {
|
||||
&self.config
|
||||
}
|
||||
|
@ -253,10 +252,10 @@ fn fetch_config(rtp: &PathBuf) -> Result<Value> {
|
|||
let mut parser = Parser::new(&content[..]);
|
||||
let res = parser.parse();
|
||||
if res.is_none() {
|
||||
write!(stderr(), "Config file parser error:");
|
||||
write!(stderr(), "Config file parser error:").ok();
|
||||
for error in parser.errors {
|
||||
write!(stderr(), "At [{}][{}] <> {}", error.lo, error.hi, error);
|
||||
write!(stderr(), "in: '{}'", &content[error.lo..error.hi]);
|
||||
write!(stderr(), "At [{}][{}] <> {}", error.lo, error.hi, error).ok();
|
||||
write!(stderr(), "in: '{}'", &content[error.lo..error.hi]).ok();
|
||||
}
|
||||
None
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![deny(
|
||||
dead_code,
|
||||
non_camel_case_types,
|
||||
non_snake_case,
|
||||
path_statements,
|
||||
|
@ -7,6 +8,7 @@
|
|||
unused_allocation,
|
||||
unused_import_braces,
|
||||
unused_imports,
|
||||
unused_must_use,
|
||||
unused_mut,
|
||||
unused_qualifications,
|
||||
while_true,
|
||||
|
|
|
@ -93,8 +93,8 @@ impl<'a> Runtime<'a> {
|
|||
};
|
||||
|
||||
if is_debugging {
|
||||
write!(stderr(), "Config: {:?}\n", cfg);
|
||||
write!(stderr(), "Store-config: {:?}\n", store_config);
|
||||
write!(stderr(), "Config: {:?}\n", cfg).ok();
|
||||
write!(stderr(), "Store-config: {:?}\n", store_config).ok();
|
||||
}
|
||||
|
||||
Store::new(storepath, store_config).map(|mut store| {
|
||||
|
|
Loading…
Reference in a new issue