Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoverbear committed Sep 6, 2023
1 parent 0eb8940 commit 2a00f10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/action/common/place_nix_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,20 @@ impl PlaceNixConfiguration {
} else {
path.into()
};

tracing::trace!(path = %path.display(), "Reading included nix.conf");
let existing_included_conf = match tokio::fs::read_to_string(&path).await {
Ok(v) => Some(v),
Err(_e) if allow_not_existing => None,
Err(e) => return Err(ActionErrorKind::Read(path, e)).map_err(Self::error)?,
Err(e) => {
return Err(ActionErrorKind::Read(path, e)).map_err(Self::error)?
},
};
if let Some(existing_included_conf) = existing_included_conf {
let lines = existing_included_conf.lines();
for line in lines {
let split = line.split_once('=');
if let Some((setting_name, setting_value)) = split
{
if let Some((setting_name, setting_value)) = split {
let setting_name = setting_name.trim();
let setting_value = setting_value.trim();
existing_conf_settings
Expand All @@ -127,8 +128,7 @@ impl PlaceNixConfiguration {
}
} else {
let split = line.split_once('=');
if let Some((setting_name, setting_value)) = split
{
if let Some((setting_name, setting_value)) = split {
let setting_name = setting_name.trim();
let setting_value = setting_value.trim();
existing_conf_settings
Expand Down

0 comments on commit 2a00f10

Please sign in to comment.