diff options
author | tilpner | 2020-09-10 23:02:54 +0200 |
---|---|---|
committer | tilpner | 2020-09-10 23:02:54 +0200 |
commit | 67bf17e99d7fc22d051faee001a95f5a7ac6e1d5 (patch) | |
tree | b4d758a0600e4424a23b44d0efc5f55f7380bf3a /src/base62.rs | |
parent | 124e48e238a19c03d7434f7f0e6fe3ef1cfdcfa6 (diff) | |
download | rpb-s3-67bf17e99d7fc22d051faee001a95f5a7ac6e1d5.tar.gz rpb-s3-67bf17e99d7fc22d051faee001a95f5a7ac6e1d5.tar.xz rpb-s3-67bf17e99d7fc22d051faee001a95f5a7ac6e1d5.zip |
Minor style improvements
Diffstat (limited to 'src/base62.rs')
-rw-r--r-- | src/base62.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/base62.rs b/src/base62.rs index a87503f..50b163b 100644 --- a/src/base62.rs +++ b/src/base62.rs @@ -1,5 +1,5 @@ pub const BASE: u8 = 62; -pub const ALPHABET: &'static [u8; BASE as usize] = +pub const ALPHABET: &[u8; BASE as usize] = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; pub fn number_to_digits(mut x: u128, base: u8) -> Vec<u8> { @@ -21,7 +21,7 @@ where I: Iterator<Item=u8> { x.fold(0, |out, digit| out * base + digit as u128) } -pub fn digits_to_string<'a, I>(x: I, alphabet: &'a [u8]) -> String +pub fn digits_to_string<I>(x: I, alphabet: &[u8]) -> String where I: Iterator<Item=u8> { x.map(|d| alphabet[d as usize] as char).collect() } |