Macro iter_python::macros::vec [−][src]
macro_rules! vec {
($($e : expr), * $(,) ?) => { ... };
($e : expr ; $count : expr) => { ... };
($($otherwise : tt) *) => { ... };
}
This is supported on crate feature
std
only.Expand description
(shortname: v!
) — Python “list” comprehensions: same as i!
,
but collect
ed into a Vec
instead.
v!
or vec!
?
v!
fallbacks to ::std::vec!
functionality,
thus allowing maximum compatiblity!
Example
use ::iter_python::macros::vec;
let v1 = vec![i for i in 1 ..= 4];
let v2 = vec![1, 2, 3, 4];
assert_eq!(v1, v2);
It has not been named vec
to prevent lints against ambiguous blob imports.