1
Fork 0

mark the map method on Vec<T> as deprecated

This exists for the sake of compatibility during the ~[T] -> Vec<T>
transition. It will be removed in the future.
This commit is contained in:
Daniel Micay 2014-03-04 19:23:57 -05:00
parent 6e7f170fed
commit 15adaf6f3e
3 changed files with 3 additions and 0 deletions

View file

@ -27,6 +27,7 @@ This API is completely unstable and subject to change.
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")];
#[allow(deprecated)];
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
#[feature(quote)];

View file

@ -350,6 +350,7 @@ impl<T> Vec<T> {
}
#[inline]
#[deprecated="Use `xs.iter().map(closure)` instead."]
pub fn map<U>(&self, f: |t: &T| -> U) -> Vec<U> {
self.iter().map(f).collect()
}

View file

@ -30,6 +30,7 @@ This API is completely unstable and subject to change.
#[allow(unknown_features)];// Note: remove it after a snapshot.
#[feature(quote)];
#[allow(deprecated)];
#[deny(non_camel_case_types)];
extern crate serialize;