From 67bf17e99d7fc22d051faee001a95f5a7ac6e1d5 Mon Sep 17 00:00:00 2001 From: tilpner Date: Thu, 10 Sep 2020 23:02:54 +0200 Subject: Minor style improvements --- src/base62.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/base62.rs') 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 { @@ -21,7 +21,7 @@ where I: Iterator { 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(x: I, alphabet: &[u8]) -> String where I: Iterator { x.map(|d| alphabet[d as usize] as char).collect() } -- cgit v1.2.3