tee: use retain_mut from std instead of the deprecated retain_mut crate

This commit is contained in:
Terts Diepraam 2023-02-11 16:44:48 +01:00
parent ae27c82020
commit bf8e9333f6
4 changed files with 2 additions and 12 deletions

7
Cargo.lock generated
View file

@ -1825,12 +1825,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "retain_mut"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c31b5c4033f8fdde8700e4657be2c497e7288f01515be52168c631e2e4d4086"
[[package]]
name = "rlimit"
version = "0.8.3"
@ -3116,7 +3110,6 @@ version = "0.0.17"
dependencies = [
"clap",
"libc",
"retain_mut",
"uucore",
]

View file

@ -309,7 +309,6 @@ rand_core = "0.6"
rayon = "1.5"
redox_syscall = "0.2"
regex = "1.7.1"
retain_mut = "0.1.7"
rust-ini = "0.18.0"
same-file = "1.0.6"
selinux = "0.3"

View file

@ -17,7 +17,6 @@ path = "src/tee.rs"
[dependencies]
clap = { workspace=true }
libc = { workspace=true }
retain_mut = { workspace=true }
uucore = { workspace=true, features=["libc"] }
[[bin]]

View file

@ -6,7 +6,6 @@
// * file that was distributed with this source code.
use clap::{builder::PossibleValue, crate_version, Arg, ArgAction, Command};
use retain_mut::RetainMut;
use std::fs::OpenOptions;
use std::io::{copy, sink, stdin, stdout, Error, ErrorKind, Read, Result, Write};
use std::path::PathBuf;
@ -301,7 +300,7 @@ impl Write for MultiWriter {
let mut aborted = None;
let mode = self.output_error_mode.clone();
let mut errors = 0;
RetainMut::retain_mut(&mut self.writers, |writer| {
self.writers.retain_mut(|writer| {
let result = writer.write_all(buf);
match result {
Err(f) => {
@ -332,7 +331,7 @@ impl Write for MultiWriter {
let mut aborted = None;
let mode = self.output_error_mode.clone();
let mut errors = 0;
RetainMut::retain_mut(&mut self.writers, |writer| {
self.writers.retain_mut(|writer| {
let result = writer.flush();
match result {
Err(f) => {