Skip to content

Commit

Permalink
Merge pull request #425 from jeckersb/clippy
Browse files Browse the repository at this point in the history
Fix various accumulated clippy lints
  • Loading branch information
cgwalters authored Mar 25, 2024
2 parents 81fbd24 + 535350e commit e70142d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn main() {
let out_dir = env::var_os("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("version.rs");
fs::write(
&dest_path,
dest_path,
"
#[allow(dead_code)]
#[allow(clippy::all)]
Expand Down
2 changes: 1 addition & 1 deletion lib/src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ pub(crate) fn fixup_etc_fstab(root: &Dir) -> Result<()> {
// Returns Ok(true) if we made a change (and we wrote the modified line)
// otherwise returns Ok(false) and the caller should write the original line.
fn edit_fstab_line(line: &str, mut w: impl Write) -> Result<bool> {
if line.starts_with("#") {
if line.starts_with('#') {
return Ok(false);
}
let parts = line.split_ascii_whitespace().collect::<Vec<_>>();
Expand Down
7 changes: 2 additions & 5 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,11 +1245,8 @@ pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> {
// At this point, all other threads should be gone.
if let Some(state) = Arc::into_inner(state) {
// If we had invoked `setenforce 0`, then let's re-enable it.
match state.selinux_state {
SELinuxFinalState::Enabled(Some(guard)) => {
guard.consume()?;
}
_ => {}
if let SELinuxFinalState::Enabled(Some(guard)) = state.selinux_state {
guard.consume()?;
}
} else {
// This shouldn't happen...but we will make it not fatal right now
Expand Down
2 changes: 1 addition & 1 deletion lib/src/lsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ pub(crate) fn ensure_dir_labeled(
let as_path = as_path
.map(Cow::Borrowed)
.unwrap_or_else(|| Utf8Path::new("/").join(destname).into());
require_label(policy, &*as_path, libc::S_IFDIR | mode.as_raw_mode())
require_label(policy, &as_path, libc::S_IFDIR | mode.as_raw_mode())
})
.transpose()
.with_context(|| format!("Labeling {local_destname}"))?;
Expand Down

0 comments on commit e70142d

Please sign in to comment.