lint: allow clippy::suspicious_open_options in sort.rs

This commit is contained in:
Krysztal112233 2024-03-22 00:42:33 +08:00
parent 2b5e7caf8b
commit 48e376e1e0
No known key found for this signature in database
GPG key ID: 331615739A596A02

View file

@ -247,6 +247,7 @@ pub struct Output {
}
impl Output {
#[allow(clippy::suspicious_open_options)]
fn new(name: Option<&str>) -> UResult<Self> {
let file = if let Some(name) = name {
// This is different from `File::create()` because we don't truncate the output yet.
@ -254,7 +255,6 @@ impl Output {
let file = OpenOptions::new()
.write(true)
.create(true)
.truncate(true)
.open(name)
.map_err(|e| SortError::OpenFailed {
path: name.to_owned(),