Skip to content

Commit

Permalink
Merge pull request #14 from kamphaus/13-single-carriage-returns
Browse files Browse the repository at this point in the history
Use single carriage returns
  • Loading branch information
christophe-kamphaus-jemmic authored Jun 15, 2023
2 parents e412744 + 61e997e commit 1387c69
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "upt"
version = "1.1.1"
version = "1.1.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
8 changes: 2 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,12 @@ fn render_duration(start: DateTime<Utc>, iso: bool) -> String {

/// Overwrite the previous line when printing the next one, passing the length of the line to be overwritten
fn clear_line(line_length: usize) {
for _i in 0..line_length {
print!("\r")
}
print!("\r");
for _i in 0..line_length {
// clear the line with spaces in case the next line is shorter
print!(" ")
}
for _i in 0..line_length {
print!("\r")
}
print!("\r")
}

use std::error::Error;
Expand Down

0 comments on commit 1387c69

Please sign in to comment.