diff options
author | root <github@bigly.dog> | 2024-03-22 15:47:51 -0700 |
---|---|---|
committer | root <github@bigly.dog> | 2024-03-22 15:49:04 -0700 |
commit | 45051911c38fa45210a0fb73c8ae0ee0231d9e28 (patch) | |
tree | 7ced027b64d61328e49d4944435982fd4287b266 | |
parent | 0c3242de189d6232d389bd4a25b2d1faaae49862 (diff) |
rm more deadcode
-rw-r--r-- | src/fzf.rs | 4 | ||||
-rw-r--r-- | src/input.rs | 7 | ||||
-rw-r--r-- | src/main.rs | 6 | ||||
-rw-r--r-- | src/subprocess.rs | 10 |
4 files changed, 12 insertions, 15 deletions
@@ -47,8 +47,8 @@ async fn reset_term() -> Result<(), Die> { pub fn stream_fzf_proc<'a>( bin: PathBuf, args: Vec<String>, - stream: impl Stream<Item = Result<OsString, Die>> + Unpin + Send + 'a, -) -> impl Stream<Item = Result<(), Die>> + Send + 'a { + stream: impl Stream<Item = Result<OsString, Die>> + Unpin + 'a, +) -> impl Stream<Item = Result<(), Die>> + 'a { let execute = format!("abort+execute:{}\x04{{+f}}", Mode::PATCH); let mut arguments = vec![ "--read0".to_owned(), diff --git a/src/input.rs b/src/input.rs index f48b1cf..69e9f7c 100644 --- a/src/input.rs +++ b/src/input.rs @@ -69,7 +69,7 @@ fn p_line(line: &str) -> Result<DiffLine, Die> { Ok(DiffLine(path, range)) } -async fn stream_patch(patches: &Path) -> impl Stream<Item = Result<LineIn, Die>> + Send { +async fn stream_patch(patches: &Path) -> impl Stream<Item = Result<LineIn, Die>> { let patches = patches.to_owned(); let fd = match File::open(&patches).await { @@ -178,10 +178,7 @@ fn stream_stdin(use_nul: bool) -> impl Stream<Item = Result<LineIn, Die>> { Either::Right(stream.try_filter_map(|x| ready(Ok(x)))) } -pub async fn stream_in( - mode: &Mode, - args: &Arguments, -) -> impl Stream<Item = Result<LineIn, Die>> + Send { +pub async fn stream_in(mode: &Mode, args: &Arguments) -> impl Stream<Item = Result<LineIn, Die>> { match mode { Mode::Initial => Either::Left(stream_stdin(args.read0)), Mode::Preview(path) | Mode::Patch(path) => Either::Right(stream_patch(path).await), diff --git a/src/main.rs b/src/main.rs index 73d4010..c9a1a32 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,8 +42,8 @@ use { fn stream_sink<'a>( opts: &Options, - stream: impl Stream<Item = Result<OsString, Die>> + Unpin + Send + 'a, -) -> impl Stream<Item = Result<(), Die>> + Send + 'a { + stream: impl Stream<Item = Result<OsString, Die>> + Unpin + 'a, +) -> impl Stream<Item = Result<(), Die>> + 'a { match (&opts.action, &opts.printer) { (Action::FzfPreview(fzf_p, fzf_a), _) => Either::Left(Either::Left(stream_fzf_proc( fzf_p.clone(), @@ -58,7 +58,7 @@ fn stream_sink<'a>( } } -async fn consume(stream: impl Stream<Item = Result<(), Die>> + Send) -> Result<(), Die> { +async fn consume(stream: impl Stream<Item = Result<(), Die>>) -> Result<(), Die> { let int = once(async { match ctrl_c().await { Err(e) => Die::IO(PathBuf::from("sigint"), e.kind()), diff --git a/src/subprocess.rs b/src/subprocess.rs index c16a627..4d40efb 100644 --- a/src/subprocess.rs +++ b/src/subprocess.rs @@ -20,9 +20,9 @@ pub struct SubprocCommand { pub fn stream_into( path: PathBuf, - writer: impl AsyncWrite + Send + Unpin, - stream: impl Stream<Item = Result<OsString, Die>> + Send + Unpin, -) -> impl Stream<Item = Result<(), Die>> + Send + writer: impl AsyncWrite + Unpin, + stream: impl Stream<Item = Result<OsString, Die>> + Unpin, +) -> impl Stream<Item = Result<(), Die>> where { let buf = BufWriter::new(writer); @@ -61,8 +61,8 @@ where pub fn stream_subproc<'a>( cmd: SubprocCommand, - stream: impl Stream<Item = Result<OsString, Die>> + Unpin + Send + 'a, -) -> impl Stream<Item = Result<(), Die>> + Send + 'a { + stream: impl Stream<Item = Result<OsString, Die>> + Unpin + 'a, +) -> impl Stream<Item = Result<(), Die>> + 'a { let subprocess = Command::new(&cmd.prog) .kill_on_drop(true) .args(&cmd.args) |