Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed Jan 30, 2024
1 parent 8330536 commit 531b288
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ fn run(term: &Term) -> Result<()> {
let width = orig_width as f64 / scale;
let height = orig_height as f64 / scale;

write_line(&term, &style("Open browser ...").italic().to_string());
write_line(term, &style("Open browser ...").italic().to_string());

let browser = Browser::default()?;

write_line(&term, &style("Open new tab ...").italic().to_string());
write_line(term, &style("Open new tab ...").italic().to_string());

let tab = browser.new_tab_with_options(CreateTarget {
url: cli.url.clone(),
Expand All @@ -90,7 +90,7 @@ fn run(term: &Term) -> Result<()> {
})?;

write_line(
&term,
term,
&style(format!(
"Waiting for element '{}' ...",
style(&cli.wait_for).cyan()
Expand Down Expand Up @@ -126,7 +126,7 @@ fn run(term: &Term) -> Result<()> {
};

write_line(
&term,
term,
&style("Capturing screenshot ...").italic().to_string(),
);

Expand All @@ -138,7 +138,7 @@ fn run(term: &Term) -> Result<()> {
)?;

write_line(
&term,
term,
&style(format!(
"Writing screenshot to '{}' ...",
style(&output_path.to_string_lossy()).cyan()
Expand All @@ -150,7 +150,7 @@ fn run(term: &Term) -> Result<()> {
fs::write(&output_path, image_data)?;

write_line(
&term,
term,
&style(format!(
"Successfully saved screenshot to '{}'.\n",
style(&output_path.to_string_lossy()).cyan()
Expand Down

0 comments on commit 531b288

Please sign in to comment.