fix: correct zero hex formatting (#195)
* fix: correct zero hex formatting * clippy
This commit is contained in:
parent
32d09736e0
commit
ef5a6a216f
|
@ -342,5 +342,11 @@ fn format_hex(num: &U256) -> String {
|
||||||
.trim_start_matches('0')
|
.trim_start_matches('0')
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
|
let stripped = if stripped.is_empty() {
|
||||||
|
"0".to_string()
|
||||||
|
} else {
|
||||||
|
stripped
|
||||||
|
};
|
||||||
|
|
||||||
format!("0x{stripped}")
|
format!("0x{stripped}")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue