Skip to content

Commit 55a0ee8

Browse files
committed
feat: v7.2.14
1 parent 0a83f62 commit 55a0ee8

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "color-output"
3-
version = "7.2.13"
3+
version = "7.2.14"
44
readme = "README.md"
55
edition = "2024"
66
authors = ["root@ltpp.vip"]
@@ -17,7 +17,7 @@ exclude = [
1717
]
1818

1919
[dependencies]
20-
hyperlane-time = "0.7.11"
20+
hyperlane-time = "0.7.12"
2121

2222
[profile.dev]
2323
incremental = false

src/color/fn.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn color256_fg_color(code: u32) -> String {
1515
let g: u32 = (code >> 8) & 0xFF;
1616
let b: u32 = code & 0xFF;
1717
let color_index: u32 = rgb_to_256_color_index(r as u8, g as u8, b as u8);
18-
format!("\x1b[38;5;{}m", color_index)
18+
format!("\x1b[38;5;{color_index}m")
1919
}
2020

2121
/// Generates an ANSI escape sequence for background colors in 256 colors.
@@ -35,7 +35,7 @@ pub fn color256_bg_color(code: u32) -> String {
3535
let g: u32 = (code >> 8) & 0xFF;
3636
let b: u32 = code & 0xFF;
3737
let color_index: u32 = rgb_to_256_color_index(r as u8, g as u8, b as u8);
38-
format!("\x1b[48;5;{}m", color_index)
38+
format!("\x1b[48;5;{color_index}m")
3939
}
4040

4141
/// Generates an ANSI escape sequence for true color foreground colors.
@@ -51,7 +51,7 @@ pub fn color256_bg_color(code: u32) -> String {
5151
/// - `String` - ANSI escape sequence for the true color foreground
5252
#[inline]
5353
pub fn rgb_fg_color(r: u8, g: u8, b: u8) -> String {
54-
format!("\x1b[38;2;{};{};{}m", r, g, b)
54+
format!("\x1b[38;2;{r};{g};{b}m")
5555
}
5656

5757
/// Generates an ANSI escape sequence for true color background colors.
@@ -67,7 +67,7 @@ pub fn rgb_fg_color(r: u8, g: u8, b: u8) -> String {
6767
/// - `String` - ANSI escape sequence for the true color background
6868
#[inline]
6969
pub fn rgb_bg_color(r: u8, g: u8, b: u8) -> String {
70-
format!("\x1b[48;2;{};{};{}m", r, g, b)
70+
format!("\x1b[48;2;{r};{g};{b}m")
7171
}
7272

7373
/// Converts RGB values to 256-color palette index with high precision.

src/task/impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'a> Task<'a> {
5050
let colored_time: &Cow<'_, str> = &Text::new_from(&text).get_display_str_cow();
5151
output_str.push_str(colored_time);
5252
}
53-
print!("{}", output_str);
53+
print!("{output_str}");
5454
std::io::stdout().flush().unwrap();
5555
self
5656
}

src/text/impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ impl<'a> Text<'a> {
5050
let color: &String = &adjusted_color.to_string();
5151
let bg_color: &String = &self.bg_color.get_str(DisplayType::Background);
5252
let mut colored_text: String = if blod {
53-
format!("{}{}{}{}{}{}", bg_color, color, BLOD, text, UNBLOD, RESET)
53+
format!("{bg_color}{color}{BLOD}{text}{UNBLOD}{RESET}")
5454
} else {
55-
format!("{}{}{}{}", bg_color, color, text, RESET)
55+
format!("{bg_color}{color}{text}{RESET}")
5656
};
5757
if self.endl {
5858
colored_text.push('\n');

0 commit comments

Comments
 (0)