From ee4392e30cfdcd4c464b0faa0af1ed79d8c0a752 Mon Sep 17 00:00:00 2001 From: Laurent Cheylus Date: Tue, 30 Apr 2024 10:04:14 +0200 Subject: [PATCH] sort: disable clippy::suspicious_open_options on OpenBSD - Avoid error on OpenBSD stable/7.5 with clippy (lint) - suspicious_open_options added in Rust 1.77.0 (1.76 used on OpenBSD 7.5) https://rust-lang.github.io/rust-clippy/master/index.html#/suspicious_open_options Fix uutils/coreutils#6290 Signed-off-by: Laurent Cheylus --- src/uu/sort/src/sort.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/uu/sort/src/sort.rs b/src/uu/sort/src/sort.rs index 1bc413aaac2..1aaa6442495 100644 --- a/src/uu/sort/src/sort.rs +++ b/src/uu/sort/src/sort.rs @@ -252,7 +252,9 @@ impl Output { let file = if let Some(name) = name { // This is different from `File::create()` because we don't truncate the output yet. // This allows using the output file as an input file. - #[allow(clippy::suspicious_open_options)] + // clippy::suspicious_open_options supported only for Rust >= 1.77.0 + // Rust version = 1.76 on OpenBSD stable/7.5 + #[cfg_attr(not(target_os = "openbsd"), allow(clippy::suspicious_open_options))] let file = OpenOptions::new() .write(true) .create(true)