Explorar o código

Add to_base62 method

Sasha Hilton %!s(int64=7) %!d(string=hai) anos
pai
achega
cbc4ee7554
Modificáronse 2 ficheiros con 7 adicións e 3 borrados
  1. 2 2
      core/src/spotify_id.rs
  2. 5 1
      playback/src/player.rs

+ 2 - 2
core/src/spotify_id.rs

@@ -1,7 +1,7 @@
 use byteorder::{BigEndian, ByteOrder};
+use extprim::u128::u128;
 use std;
 use std::fmt;
-use extprim::u128::u128;
 // Unneeded since 1.21
 #[allow(unused_imports)]
 use std::ascii::AsciiExt;
@@ -76,7 +76,7 @@ impl SpotifyId {
         let mut data = [0u8; 22];
         let sixty_two = u128::new(62);
         for i in 0..22 {
-            data[21-i] = BASE62_DIGITS[(n % sixty_two).low64() as usize];
+            data[21 - i] = BASE62_DIGITS[(n % sixty_two).low64() as usize];
             n /= sixty_two;
         }
 

+ 5 - 1
playback/src/player.rs

@@ -533,7 +533,11 @@ impl PlayerInternal {
     fn load_track(&self, track_id: SpotifyId, position: i64) -> Option<(Decoder, f32)> {
         let track = Track::get(&self.session, track_id).wait().unwrap();
 
-        info!("Loading track \"{}\" with Spotify URI \"{}\"", track.name, track_id.to_base62());
+        info!(
+            "Loading track \"{}\" with Spotify URI \"{}\"",
+            track.name,
+            track_id.to_base62()
+        );
 
         let track = match self.find_available_alternative(&track) {
             Some(track) => track,