Skip to content

Commit

Permalink
Address newest clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vn971 committed Aug 28, 2024
1 parent bdb6a19 commit 942b69f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

fn main() {
// Check that a single TLS feature has been used
#[cfg(all(feature = "rustls-tls", feature = "native-tls"))]
Expand All @@ -14,6 +15,7 @@ fn main() {
}

mod shell_completions {
#![allow(dead_code)] // Ignore unused warnings caused by including cli_args below.
extern crate structopt;

use structopt::clap::Shell;
Expand Down
1 change: 1 addition & 0 deletions src/rua_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ fn ensure_script(path: &Path, content: &[u8]) {
if !path.exists() {
let mut file = OpenOptions::new()
.create(true)
.truncate(true)
.write(true)
.open(path)
.unwrap_or_else(|e| panic!("Failed to overwrite (initialize) file {:?}, {}", path, e));
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub fn shellcheck(target: &Option<PathBuf>) -> Result<(), String> {
let stdin: &mut std::process::ChildStdin = child
.stdin
.as_mut()
.map_or(Err("Failed to open stdin for shellcheck"), Ok)?;
.ok_or("Failed to open stdin for shellcheck")?;
let bytes = rua_paths::SHELLCHECK_WRAPPER.replace("%PKGBUILD%", &target_contents);
stdin.write_all(bytes.as_bytes()).map_err(|err| {
format!(
Expand Down

0 comments on commit 942b69f

Please sign in to comment.