mirror of
https://github.com/nushell/nushell.git
synced 2025-02-17 02:50:56 +01:00
Clippy... again
This commit is contained in:
parent
a631040875
commit
b9c170d359
@ -61,9 +61,12 @@ impl WholeStreamCommand for AutoenvTrust {
|
||||
.insert(file_to_trust, hasher.finish().to_string());
|
||||
|
||||
let config_path = config::default_path_for(&Some(PathBuf::from("nu-env.toml")))?;
|
||||
let tomlstr = toml::to_string(&allowed).or_else(|_| Err(ShellError::untagged_runtime_error("Couldn't serialize allowed dirs to nu-env.toml")))?;
|
||||
fs::write(config_path, tomlstr)
|
||||
.expect("Couldn't write to toml file");
|
||||
let tomlstr = toml::to_string(&allowed).or_else(|_| {
|
||||
Err(ShellError::untagged_runtime_error(
|
||||
"Couldn't serialize allowed dirs to nu-env.toml",
|
||||
))
|
||||
})?;
|
||||
fs::write(config_path, tomlstr).expect("Couldn't write to toml file");
|
||||
|
||||
Ok(OutputStream::one(ReturnSuccess::value(
|
||||
UntaggedValue::string(".nu-env trusted!").into_value(tag),
|
||||
|
@ -78,9 +78,12 @@ impl WholeStreamCommand for AutoenvUnTrust {
|
||||
));
|
||||
}
|
||||
|
||||
let tomlstr = toml::to_string(&allowed).or_else(|_| Err(ShellError::untagged_runtime_error("Couldn't serialize allowed dirs to nu-env.toml")))?;
|
||||
fs::write(config_path, tomlstr)
|
||||
.expect("Couldn't write to toml file");
|
||||
let tomlstr = toml::to_string(&allowed).or_else(|_| {
|
||||
Err(ShellError::untagged_runtime_error(
|
||||
"Couldn't serialize allowed dirs to nu-env.toml",
|
||||
))
|
||||
})?;
|
||||
fs::write(config_path, tomlstr).expect("Couldn't write to toml file");
|
||||
|
||||
Ok(OutputStream::one(ReturnSuccess::value(
|
||||
UntaggedValue::string(".nu-env untrusted!").into_value(tag),
|
||||
|
@ -42,9 +42,10 @@ impl DirectorySpecificEnvironment {
|
||||
== Some(&hasher.finish().to_string())
|
||||
{
|
||||
return Ok(content.parse::<toml::Value>().or_else(|_| {
|
||||
Err(ShellError::untagged_runtime_error(
|
||||
format!("Could not parse {:?}. Is it well-formed?", wdirenv)
|
||||
))
|
||||
Err(ShellError::untagged_runtime_error(format!(
|
||||
"Could not parse {:?}. Is it well-formed?",
|
||||
wdirenv
|
||||
)))
|
||||
})?);
|
||||
}
|
||||
return Err(ShellError::untagged_runtime_error(
|
||||
|
Loading…
Reference in New Issue
Block a user