summary refs log tree commit diff
path: root/src/libcollections/smallintmap.rs
AgeCommit message (Collapse)AuthorLines
2014-09-22Fix deprecation warnings in check-docs.Victor Berger-2/+2
Fallout of closing #17185.
2014-09-22Update calls of deprecated functions in macros.Victor Berger-8/+8
Fallout of #17185.
2014-09-16Fallout from renamingAaron Turon-10/+10
2014-09-16Align with _mut conventionsAaron Turon-2/+16
As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. [breaking-change]
2014-09-03Fix spelling errors and capitalization.Joseph Crail-1/+1
2014-08-29Register new snapshotsAlex Crichton-18/+0
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-2/+20
2014-08-19A few minor documentation fixesP1start-31/+33
2014-08-16librustc: Forbid external crates, imports, and/or items from beingPatrick Walton-1/+1
declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]
2014-08-12Deprecation fallout in libcollectionsAaron Turon-1/+2
2014-08-12Implement Index for SmallIntMapP1start-4/+45
This also deprecates SmallIntMap::get. Use indexing instead.
2014-07-28Implement Ord for TrieMap/TrieSet/SmallIntMap/Bitv/BitvSetnham-0/+7
2014-07-28Implement PartialOrd for SmallIntMapnham-0/+39
2014-07-27auto merge of #15963 : nham/rust/moar_15294, r=alexcrichtonbors-1/+100
Implements PartialEq/Eq/Clone/Hash/FromIterator/Extendable for SmallIntMap and Clone/Show for TrieMap/TrieSet. cc #15294
2014-07-26Manually implement Hash for SmallIntMapnham-12/+20
2014-07-26Small fixes for testsnham-7/+7
2014-07-25Fix a typo in SmallIntMap documentationnham-1/+1
2014-07-25Implement PartialEq/Eq/Clone/Hash/FromIterator/Extendable for SmallIntMap ↵nham-0/+91
and Show/Clone for TrieMap and TrieSet
2014-07-25Add methods for obtaining iterators over the keys and values of a SmallIntMapnham-0/+47
2014-07-24auto merge of #15945 : treeman/rust/doc-smallint-update, r=alexcrichtonbors-4/+44
Forgot two methods, but @alexcrichton was a bit too quick to accept #15943, so I made a new PR.
2014-07-24Document update and update_with_key in SmallIntMap.Jonas Hietala-4/+44
Move update above for better docs progression.
2014-07-24Document SmallIntMap with examples.Jonas Hietala-2/+119
2014-07-24Format documentation for SmallIntMap.Jonas Hietala-17/+15
2014-07-23Remove kludgy imports from vec! macroBrian Anderson-1/+1
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-1/+1
[breaking-change]
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-17/+17
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-15Register new snapshotsAlex Crichton-12/+0
2014-06-11std: Remove i18n/l10n from format!Alex Crichton-0/+12
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-09collections: Add missing Default implsTom Jakubowski-0/+6
Add Default impls for TreeMap, TreeSet, SmallIntMap, BitvSet, DList, PriorityQueue, RingBuf, TrieMap, and TrieSet.
2014-06-09core: Move the collections traits to libcollectionsAlex Crichton-1/+3
This commit moves Mutable, Map, MutableMap, Set, and MutableSet from `core::collections` to the `collections` crate at the top-level. Additionally, this removes the `deque` module and moves the `Deque` trait to only being available at the top-level of the collections crate. All functionality continues to be reexported through `std::collections`. [breaking-change]
2014-06-08core: Rename `container` mod to `collections`. Closes #12543Brian Anderson-1/+1
Also renames the `Container` trait to `Collection`. [breaking-change]
2014-06-07Implement Show for SmallIntMapAdolfo Ochagavía-0/+27
2014-06-06Rename Iterator::len to countAaron Turon-1/+1
This commit carries out the request from issue #14678: > The method `Iterator::len()` is surprising, as all the other uses of > `len()` do not consume the value. `len()` would make more sense to be > called `count()`, but that would collide with the current > `Iterator::count(|T| -> bool) -> unit` method. That method, however, is > a bit redundant, and can be easily replaced with > `iter.filter(|x| x < 5).count()`. > After this change, we could then define the `len()` method > on `iter::ExactSize`. Closes #14678. [breaking-change]
2014-06-05Fallout from the libcollections movementAlex Crichton-0/+1
2014-06-05std: Recreate a `collections` moduleAlex Crichton-4/+8
As with the previous commit with `librand`, this commit shuffles around some `collections` code. The new state of the world is similar to that of librand: * The libcollections crate now only depends on libcore and liballoc. * The standard library has a new module, `std::collections`. All functionality of libcollections is reexported through this module. I would like to stress that this change is purely cosmetic. There are very few alterations to these primitives. There are a number of notable points about the new organization: * std::{str, slice, string, vec} all moved to libcollections. There is no reason that these primitives shouldn't be necessarily usable in a freestanding context that has allocation. These are all reexported in their usual places in the standard library. * The `hashmap`, and transitively the `lru_cache`, modules no longer reside in `libcollections`, but rather in libstd. The reason for this is because the `HashMap::new` contructor requires access to the OSRng for initially seeding the hash map. Beyond this requirement, there is no reason that the hashmap could not move to libcollections. I do, however, have a plan to move the hash map to the collections module. The `HashMap::new` function could be altered to require that the `H` hasher parameter ascribe to the `Default` trait, allowing the entire `hashmap` module to live in libcollections. The key idea would be that the default hasher would be different in libstd. Something along the lines of: // src/libstd/collections/mod.rs pub type HashMap<K, V, H = RandomizedSipHasher> = core_collections::HashMap<K, V, H>; This is not possible today because you cannot invoke static methods through type aliases. If we modified the compiler, however, to allow invocation of static methods through type aliases, then this type definition would essentially be switching the default hasher from `SipHasher` in libcollections to a libstd-defined `RandomizedSipHasher` type. This type's `Default` implementation would randomly seed the `SipHasher` instance, and otherwise perform the same as `SipHasher`. This future state doesn't seem incredibly far off, but until that time comes, the hashmap module will live in libstd to not compromise on functionality. * In preparation for the hashmap moving to libcollections, the `hash` module has moved from libstd to libcollections. A previously snapshotted commit enables a distinct `Writer` trait to live in the `hash` module which `Hash` implementations are now parameterized over. Due to using a custom trait, the `SipHasher` implementation has lost its specialized methods for writing integers. These can be re-added backwards-compatibly in the future via default methods if necessary, but the FNV hashing should satisfy much of the need for speedier hashing. A list of breaking changes: * HashMap::{get, get_mut} no longer fails with the key formatted into the error message with `{:?}`, instead, a generic message is printed. With backtraces, it should still be not-too-hard to track down errors. * The HashMap, HashSet, and LruCache types are now available through std::collections instead of the collections crate. * Manual implementations of hash should be parameterized over `hash::Writer` instead of just `Writer`. [breaking-change]
2014-05-30lib{std,core,debug,rustuv,collections,native,regex}: Fix snake_case errors.Kevin Butler-7/+7
A number of functions/methods have been moved or renamed to align better with rust standard conventions. std::reflect::MovePtrAdaptor => MovePtrAdaptor::new debug::reflect::MovePtrAdaptor => MovePtrAdaptor::new std::repr::ReprVisitor => ReprVisitor::new debug::repr::ReprVisitor => ReprVisitor::new rustuv::homing::HomingIO.go_to_IO_home => go_to_io_home [breaking-change]
2014-05-22Remove a slew of old deprecated functionsAlex Crichton-15/+1
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-1/+1
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-2/+2
2014-04-28Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is ↵Jonathan S-12/+11
provided (everywhere but treemap) This commit deprecates rev_iter, mut_rev_iter, move_rev_iter everywhere (except treemap) and also deprecates related functions like rsplit, rev_components, and rev_str_components. In every case, these functions can be replaced with the non-reversed form followed by a call to .rev(). To make this more concrete, a translation table for all functional changes necessary follows: * container.rev_iter() -> container.iter().rev() * container.mut_rev_iter() -> container.mut_iter().rev() * container.move_rev_iter() -> container.move_iter().rev() * sliceorstr.rsplit(sep) -> sliceorstr.split(sep).rev() * path.rev_components() -> path.components().rev() * path.rev_str_components() -> path.str_components().rev() In terms of the type system, this change also deprecates any specialized reversed iterator types (except in treemap), opting instead to use Rev directly if any type annotations are needed. However, since methods directly returning reversed iterators are now discouraged, the need for such annotations should be small. However, in those cases, the general pattern for conversion is to take whatever follows Rev in the original reversed name and surround it with Rev<>: * RevComponents<'a> -> Rev<Components<'a>> * RevStrComponents<'a> -> Rev<StrComponents<'a>> * RevItems<'a, T> -> Rev<Items<'a, T>> * etc. The reasoning behind this change is that it makes the standard API much simpler without reducing readability, performance, or power. The presence of functions such as rev_iter adds more boilerplate code to libraries (all of which simply call .iter().rev()), clutters up the documentation, and only helps code by saving two characters. Additionally, the numerous type synonyms that were used to make the type signatures look nice like RevItems add even more boilerplate and clutter up the docs even more. With this change, all that cruft goes away. [breaking-change]
2014-04-11libtest: rename `BenchHarness` to `Bencher`Liigo Zhuang-17/+17
Closes #12640
2014-04-09collections: replace all ~[T] with Vec<T>.Huon Wilson-10/+10
2014-04-04extra: Add with_capacity to PriorityQueue and SmallIntMapErick Tryzelaar-0/+5
2014-03-31collections: Switch field privacy as necessaryAlex Crichton-7/+7
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-1/+1
Closes #2569
2014-03-20rename std::vec -> std::sliceDaniel Micay-4/+4
Closes #12702
2014-03-06fix typos with with repeated words, just like this sentence.Kang Seonghoon-1/+1
2014-02-20move extra::test to libtestLiigo Zhuang-2/+2
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-1/+1
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-0/+529