Browse Source

Remove deprecation warnings.

Paul Lietar 9 years ago
parent
commit
09e180b0e2
2 changed files with 4 additions and 5 deletions
  1. 1 1
      src/lib.rs
  2. 3 4
      src/metadata.rs

+ 1 - 1
src/lib.rs

@@ -1,6 +1,6 @@
 #![crate_name = "librespot"]
 
-#![feature(plugin,zero_one,iter_arith,slice_bytes,mpsc_select)]
+#![feature(plugin,zero_one,iter_arith,slice_bytes,mpsc_select,clone_from_slice)]
 
 #![plugin(protobuf_macros)]
 #[macro_use] extern crate lazy_static;

+ 3 - 4
src/metadata.rs

@@ -1,9 +1,8 @@
 use eventual::Async;
-use protobuf::{self, Message};
+use protobuf;
 use std::any::{Any, TypeId};
 use std::collections::HashMap;
 use std::fmt;
-use std::slice::bytes::copy_memory;
 use std::sync::{Arc, Condvar, Mutex, MutexGuard, Weak};
 use std::thread;
 
@@ -35,7 +34,7 @@ impl MetadataTrait for Track {
             files: msg.get_file().iter()
                 .map(|file| {
                     let mut dst = [0u8; 20];
-                    copy_memory(&file.get_file_id(), &mut dst);
+                    dst.clone_from_slice(&file.get_file_id());
                     FileId(dst)
                 })
                 .collect(),
@@ -67,7 +66,7 @@ impl MetadataTrait for Album {
             covers: msg.get_cover_group().get_image().iter()
                 .map(|image| {
                     let mut dst = [0u8; 20];
-                    copy_memory(&image.get_file_id(), &mut dst);
+                    dst.clone_from_slice(&image.get_file_id());
                     FileId(dst)
                 })
                 .collect(),