libstd: Implement some convenience methods on vectors

This commit is contained in:
Patrick Walton
2014-02-18 21:36:51 -08:00
parent f8893ed5d9
commit 03b791095d
5 changed files with 223 additions and 11 deletions

View File

@@ -358,3 +358,13 @@ macro_rules! local_data_key(
macro_rules! try(
($e:expr) => (match $e { Ok(e) => e, Err(e) => return Err(e) })
)
#[macro_export]
macro_rules! vec(
($($e:expr),*) => ({
let mut temp = ::std::vec_ng::Vec::new();
$(temp.push($e);)*
temp
})
)