Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rachancheet committed Mar 23, 2024
1 parent 19d5c38 commit fe9d170
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 15 deletions.
39 changes: 39 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 4 additions & 15 deletions wayshot/src/wayshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,6 @@ fn main() -> Result<()> {
}
}

let file = match cli.file {
Some(mut pathbuf) => {
if pathbuf.to_string_lossy() == "-" {
None
} else {
if pathbuf.is_dir() {
pathbuf.push(utils::get_default_file_name(requested_encoding));
}
Some(pathbuf)
}
}
None => Some(utils::get_default_file_name(requested_encoding)),
};

let wayshot_conn = WayshotConnection::new()?;

if cli.list_outputs {
Expand Down Expand Up @@ -120,11 +106,14 @@ fn main() -> Result<()> {

let mut stdout_print = false;
let file = match cli.file {
Some(pathbuf) => {
Some(mut pathbuf) => {
if pathbuf.to_string_lossy() == "-" {
stdout_print = true;
None
} else {
if pathbuf.is_dir() {
pathbuf.push(utils::get_default_file_name(requested_encoding));
}
Some(pathbuf)
}
}
Expand Down

0 comments on commit fe9d170

Please sign in to comment.