projects
/
crypto_lab1.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Improve the function 'from_elem(..)'.
[crypto_lab1.git]
/
lab1_rust
/
src
/
utils.rs
1
use
std
::
iter
;
2
3
pub fn
from_elem
<
T
:
Clone
>(
nb_elem
:
uint
,
t
:
T
) ->
Vec
<
T
> {
4
iter
::
repeat
(
t
).
take
(
nb_elem
).
collect
()
5
}