Skip to content

Commit

Permalink
make lots of functions const that weren't before; it is also technica…
Browse files Browse the repository at this point in the history
…lly possible to make the style difference calculations const (using while loops, but for now I have not pursued that
  • Loading branch information
bzm3r committed Oct 13, 2023
1 parent a4dbb5f commit d29ecb1
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 76 deletions.
2 changes: 1 addition & 1 deletion examples/hyperlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn main() {
let link = Color::Blue
.underline()
.paint("Link to example.com")
.hyperlink("https://example.com");
.hyperlink_content("https://example.com");

println!("{}", link);
sleep(sleep_ms);
Expand Down
2 changes: 1 addition & 1 deletion src/difference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl Style {
} else {
// No colors or formatting options were turned off. But there might
// have been things turned on, or colors that have changed. This
// case handles that.
// case
let turned_off_in_next = BoolStyle::turned_off(self.into(), next.into());
if turned_off_in_next.formats.is_empty() && turned_off_in_next.coloring.is_empty() {
let turned_on_from_self = BoolStyle::turned_on(self.into(), next.into());
Expand Down
Loading

0 comments on commit d29ecb1

Please sign in to comment.