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

View file

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

View file

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

View file

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