chore: Cleanup code - Commit cff9a9b8 - AstroNvim/astrocommunity-cli
-
-
Uzair Aftab
committed 2 years ago
| skipped 27 lines |
28 | 28 | | } |
29 | 29 | | |
30 | 30 | | pub fn write_to_stdin(&mut self, input: &[u8]) -> Result<()> { |
31 | | - | match self.process.stdin.as_mut().unwrap().write_all(input) { |
32 | | - | Err(why) => panic!("couldn't write to fzf stdin: {}", why), |
33 | | - | _ => {} |
| 31 | + | if let Err(why) = self.process.stdin.as_mut().unwrap().write_all(input) { |
| 32 | + | panic!("couldn't write to fzf stdin: {}", why) |
34 | 33 | | } |
35 | 34 | | Ok(()) |
36 | 35 | | } |
37 | 36 | | |
38 | 37 | | pub fn read_from_stdout(&mut self) -> Result<String> { |
39 | 38 | | let mut s = String::new(); |
40 | | - | match self.process.stdout.as_mut().unwrap().read_to_string(&mut s) { |
41 | | - | Err(why) => panic!("couldn't read fzf stdout: {}", why), |
42 | | - | _ => {} |
| 39 | + | if let Err(why) = self.process.stdout.as_mut().unwrap().read_to_string(&mut s) { |
| 40 | + | panic!("couldn't wait on fzf: {}", why) |
43 | 41 | | } |
44 | 42 | | Ok(s) |
45 | 43 | | } |
| skipped 2 lines |
1 | 1 | | mod fzf; |
2 | 2 | | mod git_operations; |
3 | 3 | | |
4 | | - | use std::{ |
5 | | - | borrow::Cow, |
6 | | - | io::{self}, |
7 | | - | }; |
| 4 | + | use std::io; |
8 | 5 | | |
9 | 6 | | use anyhow::{Ok, Result}; |
10 | 7 | | |
11 | 8 | | use itertools::Itertools; |
12 | | - | use serde::Deserialize; |
13 | 9 | | |
14 | 10 | | use cli_clipboard::{ClipboardContext, ClipboardProvider}; |
15 | 11 | | |
| skipped 60 lines |
Page is in error, reload to recover