Skip to content

Commit e70142d

Browse files
authored
Merge pull request #425 from jeckersb/clippy
Fix various accumulated clippy lints
2 parents 81fbd24 + 535350e commit e70142d

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

lib/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
let out_dir = env::var_os("OUT_DIR").unwrap();
99
let dest_path = Path::new(&out_dir).join("version.rs");
1010
fs::write(
11-
&dest_path,
11+
dest_path,
1212
"
1313
#[allow(dead_code)]
1414
#[allow(clippy::all)]

lib/src/deploy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ pub(crate) fn fixup_etc_fstab(root: &Dir) -> Result<()> {
395395
// Returns Ok(true) if we made a change (and we wrote the modified line)
396396
// otherwise returns Ok(false) and the caller should write the original line.
397397
fn edit_fstab_line(line: &str, mut w: impl Write) -> Result<bool> {
398-
if line.starts_with("#") {
398+
if line.starts_with('#') {
399399
return Ok(false);
400400
}
401401
let parts = line.split_ascii_whitespace().collect::<Vec<_>>();

lib/src/install.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,11 +1245,8 @@ pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> {
12451245
// At this point, all other threads should be gone.
12461246
if let Some(state) = Arc::into_inner(state) {
12471247
// If we had invoked `setenforce 0`, then let's re-enable it.
1248-
match state.selinux_state {
1249-
SELinuxFinalState::Enabled(Some(guard)) => {
1250-
guard.consume()?;
1251-
}
1252-
_ => {}
1248+
if let SELinuxFinalState::Enabled(Some(guard)) = state.selinux_state {
1249+
guard.consume()?;
12531250
}
12541251
} else {
12551252
// This shouldn't happen...but we will make it not fatal right now

lib/src/lsm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ pub(crate) fn ensure_dir_labeled(
347347
let as_path = as_path
348348
.map(Cow::Borrowed)
349349
.unwrap_or_else(|| Utf8Path::new("/").join(destname).into());
350-
require_label(policy, &*as_path, libc::S_IFDIR | mode.as_raw_mode())
350+
require_label(policy, &as_path, libc::S_IFDIR | mode.as_raw_mode())
351351
})
352352
.transpose()
353353
.with_context(|| format!("Labeling {local_destname}"))?;

0 commit comments

Comments
 (0)