Skip to content

Commit 03cc250

Browse files
committed
fix: clippy warnings for hexadecimal and octal conversions vice versa
1 parent 90faee1 commit 03cc250

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/conversions/hexadecimal_to_octal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn hexadecimal_to_octal(hex_str: &str) -> Result<String, &'static str> {
1212
}
1313

1414
// Validate hexadecimal string
15-
if !hex_str.chars().all(|c| c.is_digit(16)) {
15+
if !hex_str.chars().all(|c| c.is_ascii_hexdigit()) {
1616
return Err("Invalid hexadecimal string");
1717
}
1818

src/conversions/octal_to_hexadecimal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn octal_to_hexadecimal(octal_str: &str) -> Result<String, &'static str> {
2525
}
2626

2727
// Convert decimal to hexadecimal
28-
Ok(format!("{:X}", decimal))
28+
Ok(format!("{decimal:X}"))
2929
}
3030

3131
#[cfg(test)]

0 commit comments

Comments
 (0)