Changes according the latest Rust nightly.
[crypto_lab1.git] / lab1_rust / src / utils.rs
diff --git a/lab1_rust/src/utils.rs b/lab1_rust/src/utils.rs
new file mode 100644 (file)
index 0000000..b6be23a
--- /dev/null
@@ -0,0 +1,8 @@
+
+pub fn from_elem<T : Copy>(nb_elem: uint, t: T) -> Vec<T> {
+   let mut v = Vec::with_capacity(nb_elem);
+   for _ in range(0u, nb_elem) {
+      v.push(t);
+   }
+   v
+}
\ No newline at end of file