diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-02-19 19:29:58 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-23 00:35:11 -0800 |
| commit | 2a14e084cfd8cf9a9149d0b7c6329b0dad0521d0 (patch) | |
| tree | 78090dacffcdda10a36a6e538f3f73d3d3a6e35c /src/doc/tutorial.md | |
| parent | edf351e9f7d17777b1385093bfa7b6654e662d44 (diff) | |
| download | rust-2a14e084cfd8cf9a9149d0b7c6329b0dad0521d0.tar.gz rust-2a14e084cfd8cf9a9149d0b7c6329b0dad0521d0.zip | |
Move std::{trie, hashmap} to libcollections
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
Diffstat (limited to 'src/doc/tutorial.md')
| -rw-r--r-- | src/doc/tutorial.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md index 6454e22b896..304dc1fb5af 100644 --- a/src/doc/tutorial.md +++ b/src/doc/tutorial.md @@ -1977,8 +1977,8 @@ illegal to copy and pass by value. Generic `type`, `struct`, and `enum` declarations follow the same pattern: ~~~~ -use std::hashmap::HashMap; -type Set<T> = HashMap<T, ()>; +extern crate collections; +type Set<T> = collections::HashMap<T, ()>; struct Stack<T> { elements: ~[T] @@ -1988,6 +1988,7 @@ enum Option<T> { Some(T), None } +# fn main() {} ~~~~ These declarations can be instantiated to valid types like `Set<int>`, |
