Skip to content

Commit

Permalink
sort: disable clippy::suspicious_open_options on OpenBSD
Browse files Browse the repository at this point in the history
- 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#6290

Signed-off-by: Laurent Cheylus <foxy@free.fr>
  • Loading branch information
lcheylus committed Apr 30, 2024
1 parent 277c939 commit ee4392e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/uu/sort/src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ee4392e

Please sign in to comment.