this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: cleaning up some comments and naming

+5 -4
+5 -4
src/main.rs
··· 91 91 compression: u32, 92 92 } 93 93 94 - fn command_targets<T: Compressor>(compressor: T) -> Result<(), io::Error> { 94 + fn command<T: Compressor>(compressor: T) -> Result<(), io::Error> { 95 95 let args = compressor.common_args(); 96 96 // Input prefers stdin if that is a pipe, and falls back to reading from a file. 97 97 let input = match std::io::stdin().is_terminal() { 98 98 true => CmprssInput::Path(Path::new(&args.input)), 99 99 false => CmprssInput::Pipe(std::io::stdin()), 100 100 }; 101 + // Define the default output filename for use if we need it later 101 102 let default_output = match args.extract { 102 103 true => compressor.default_extracted_filename(Path::new(&args.input)), 103 104 false => compressor.default_compressed_filename(Path::new(&args.input)), ··· 128 129 } else if args.extract { 129 130 compressor.extract(input, output)?; 130 131 } else { 131 - // Neither compress or extract is specified. 132 + // Neither compress nor extract is specified. 132 133 // Compress by default, warn if if looks like an archive. 133 134 match &input { 134 135 CmprssInput::Path(path) => { ··· 162 163 fn main() -> Result<(), io::Error> { 163 164 let args = CmprssArgs::parse(); 164 165 match args.format { 165 - Some(Format::Tar(a)) => command_targets(parse_tar(a)), 166 + Some(Format::Tar(a)) => command(parse_tar(a)), 166 167 //Some(Format::Extract(a)) => command_extract(a), 167 - Some(Format::Gzip(a)) => command_targets(parse_gzip(a)), 168 + Some(Format::Gzip(a)) => command(parse_gzip(a)), 168 169 _ => Err(io::Error::new(io::ErrorKind::Other, "unknown input")), 169 170 } 170 171 }