X-Git-Url: http://git.euphorik.ch/?p=crypto_lab1.git;a=blobdiff_plain;f=lab1_rust%2Fsrc%2Futils.rs;fp=lab1_rust%2Fsrc%2Futils.rs;h=b6be23ae0ef32e3e64765286ef446801ff67ac70;hp=0000000000000000000000000000000000000000;hb=d7f0bb987b21e93a5798403d294f7905151682f7;hpb=a8641e8dd205140af9206e82169ff5ad107c23f8 diff --git a/lab1_rust/src/utils.rs b/lab1_rust/src/utils.rs new file mode 100644 index 0000000..b6be23a --- /dev/null +++ b/lab1_rust/src/utils.rs @@ -0,0 +1,8 @@ + +pub fn from_elem(nb_elem: uint, t: T) -> Vec { + let mut v = Vec::with_capacity(nb_elem); + for _ in range(0u, nb_elem) { + v.push(t); + } + v +} \ No newline at end of file