Use single fixed-width format! macro for SpotifyId.to_base16

This commit is contained in:
Will Stott 2019-10-22 18:31:18 +01:00
parent ac1c31b786
commit a7243ff8ce
2 changed files with 4 additions and 1 deletions

3
Cargo.lock generated
View file

@ -492,7 +492,10 @@ name = "env_logger"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]

View file

@ -55,7 +55,7 @@ impl SpotifyId {
}
pub fn to_base16(&self) -> String {
format!("{:0>32}", format!("{:x}", self.0))
format!("{:032x}", self.0)
}
pub fn to_base62(&self) -> String {