Changes according the latest Rust nightly.
[crypto_lab1.git] / lab1_rust / src / end_point.rs
index d2cedcb..83967da 100644 (file)
@@ -5,6 +5,7 @@ use std::thread::Thread;
 use packet;
 use packet::{ Packet, ReadingResult, PacketType };
 use packet::PacketType::{ Command, Answer, Error };
+use utils::from_elem;
 
 // Default timeout when waiting data on a stream (for instance: 'TcpStream::read').
 static DEFAULT_TIMEOUT: Option<u64> = Some(500); // [ms].
@@ -195,7 +196,7 @@ impl Client {
          // 5)
          |client: &mut Client| -> bool {
             println!("Sending a packet with too small data...");
-            let command = Command(Packet::new_packet_data(0, Vec::from_elem(6, 0x00)));
+            let command = Command(Packet::new_packet_data(0, from_elem(6, 0x00)));
             match client.end_point.send_with_result(command) {
                Ok(Err(packet::ReadingError::IO( IoError { kind: io::TimedOut, .. }))) => true, // OK: the server should not send any packet.
                other => {
@@ -207,7 +208,7 @@ impl Client {
          // 6)
          |client: &mut Client| -> bool {
             println!("Sending a packet with too large data...");
-            let command = Command(Packet::new_packet_data(0, Vec::from_elem(40, 0x00)));
+            let command = Command(Packet::new_packet_data(0, from_elem(40, 0x00)));
             match client.end_point.send_with_result(command) {
                Ok(Err(packet::ReadingError::IO( IoError { kind: io::TimedOut, .. }))) => true, // OK: the server should not send any packet.
                other => {