summaryrefslogtreecommitdiffstats
path: root/lib/core/libimagrt/src
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2019-08-27 10:45:23 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-08-28 18:18:40 +0200
commitc7ac440c92d4ffc2c129c63cade551a8608523e3 (patch)
tree32bb42e1b6ff9f06db9243266a5f500468081a1b /lib/core/libimagrt/src
parentf0a734839da390914775b17094a8ab324e0db7b8 (diff)
[Auto] lib/core/rt: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'lib/core/libimagrt/src')
-rw-r--r--lib/core/libimagrt/src/configuration.rs4
-rw-r--r--lib/core/libimagrt/src/logger.rs22
-rw-r--r--lib/core/libimagrt/src/runtime.rs10
3 files changed, 18 insertions, 18 deletions
diff --git a/lib/core/libimagrt/src/configuration.rs b/lib/core/libimagrt/src/configuration.rs
index c6a45477..62233be9 100644
--- a/lib/core/libimagrt/src/configuration.rs
+++ b/lib/core/libimagrt/src/configuration.rs
@@ -121,10 +121,10 @@ pub fn override_config(val: &mut Value, v: Vec<String>) -> Result<()> {
.map(|(k, v)| {
let value = val.read_mut(&k)
.context(EM::TomlQueryError)?
- .ok_or_else(|| Error::from(err_msg("No config value there, cannot override.")))?;
+ .ok_or_else(|| err_msg("No config value there, cannot override."))?;
let new_value = into_value(value, v)
- .ok_or_else(|| Error::from(err_msg("Config override type not matching")))?;
+ .ok_or_else(|| err_msg("Config override type not matching"))?;
info!("Successfully overridden: {} = {}", k, new_value);
*value = new_value;
diff --git a/lib/core/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs
index 468d798b..1f2da580 100644
--- a/lib/core/libimagrt/src/logger.rs
+++ b/lib/core/libimagrt/src/logger.rs
@@ -90,18 +90,18 @@ impl ImagLogger {
{
use self::log_lvl_aggregate::*;
- let _ = aggregate::<Trace>(&mut handlebars, config, "TRACE")?;
- let _ = aggregate::<Debug>(&mut handlebars, config, "DEBUG")?;
- let _ = aggregate::<Info>(&mut handlebars, config, "INFO")?;
- let _ = aggregate::<Warn>(&mut handlebars, config, "WARN")?;
- let _ = aggregate::<Error>(&mut handlebars, config, "ERROR")?;
+ aggregate::<Trace>(&mut handlebars, config, "TRACE")?;
+ aggregate::<Debug>(&mut handlebars, config, "DEBUG")?;
+ aggregate::<Info>(&mut handlebars, config, "INFO")?;
+ aggregate::<Warn>(&mut handlebars, config, "WARN")?;
+ aggregate::<Error>(&mut handlebars, config, "ERROR")?;
}
Ok(ImagLogger {
global_loglevel : aggregate_global_loglevel(matches, config)?,
global_destinations : aggregate_global_destinations(config)?,
module_settings : aggregate_module_settings(matches, config)?,
- handlebars : handlebars,
+ handlebars,
})
}
@@ -171,12 +171,12 @@ impl Log for ImagLogger {
if set {
module_setting.destinations.as_ref().map(|destinations| for d in destinations {
// If there's an error, we cannot do anything, can we?
- let _ = log_to_destination(&d);
+ log_to_destination(&d);
});
for d in self.global_destinations.iter() {
// If there's an error, we cannot do anything, can we?
- let _ = log_to_destination(&d);
+ log_to_destination(&d);
}
}
})
@@ -185,7 +185,7 @@ impl Log for ImagLogger {
// Yes, we log
for d in self.global_destinations.iter() {
// If there's an error, we cannot do anything, can we?
- let _ = log_to_destination(&d);
+ log_to_destination(&d);
}
}
});
@@ -199,7 +199,7 @@ fn match_log_level_str(s: &str) -> Result<Level> {
"info" => Ok(Level::Info),
"warn" => Ok(Level::Warn),
"error" => Ok(Level::Error),
- lvl => return Err(format_err!("Invalid logging level: {}", lvl)),
+ lvl => Err(format_err!("Invalid logging level: {}", lvl)),
}
}
@@ -287,7 +287,7 @@ fn aggregate_global_destinations(config: Option<&Value>)
.as_array()
.ok_or_else(|| {
let msg = "Type error at 'imag.logging.destinations', expected 'Array'";
- Error::from(err_msg(msg))
+ err_msg(msg)
})
.and_then(translate_destinations),
}
diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs
index 89b2009d..4bbca09b 100644
--- a/lib/core/libimagrt/src/runtime.rs
+++ b/lib/core/libimagrt/src/runtime.rs
@@ -153,8 +153,8 @@ impl<'a> Runtime<'a> {
store_result.map(|store| Runtime {
cli_matches: matches,
configuration: config,
- rtp: rtp,
- store: store,
+ rtp,
+ store,
has_output_pipe,
has_input_pipe,
@@ -381,10 +381,10 @@ impl<'a> Runtime<'a> {
.map(String::from)
.ok_or_else(|| {
self.config()
- .ok_or_else(|| Error::from(err_msg("No Configuration!")))
+ .ok_or_else(|| err_msg("No Configuration!"))
.and_then(|v| match v.read("rt.editor")? {
Some(&Value::String(ref s)) => Ok(Some(s.clone())),
- Some(_) => Err(Error::from(err_msg("Type error at 'rt.editor', expected 'String'"))),
+ Some(_) => Err(err_msg("Type error at 'rt.editor', expected 'String'")),
None => Ok(None),
})
})
@@ -617,7 +617,7 @@ fn get_override_specs(matches: &ArgMatches) -> Vec<String> {
.map(|values| {
values
.filter(|s| {
- let b = s.contains("=");
+ let b = s.contains('=');
if !b { warn!("override '{}' does not contain '=' - will be ignored!", s); }
b
})