Commit Graph

83 Commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
a14d72d49e Implemented list::is_empty() based on Container trait 2014-02-27 08:35:47 -04:00
Bruno de Oliveira Abinader
e589fcffcc Implemented list::len() based on Container trait 2014-02-27 08:35:46 -04:00
Bruno de Oliveira Abinader
197116d7ce Removed list::any() in favor of iter().any() 2014-02-27 08:35:46 -04:00
Bruno de Oliveira Abinader
d681907064 Removed list::find() in favor of iter().find() 2014-02-27 08:35:46 -04:00
Bruno de Oliveira Abinader
a09a4b882d Removed list::foldl() in favor of iter().fold() 2014-02-27 08:35:45 -04:00
Bruno de Oliveira Abinader
52524bfe88 Implemented Items<'a, T> for List<T> 2014-02-27 08:35:18 -04:00
Bruno de Oliveira Abinader
2b362768ff Modified list::from_vec() to return List<T> 2014-02-27 08:35:17 -04:00
Bruno de Oliveira Abinader
1e6151a770 Renamed variables 2014-02-27 08:35:16 -04:00
bors
25d68366b7 auto merge of #12522 : erickt/rust/hash, r=alexcrichton
This patch series does a couple things:

* replaces manual `Hash` implementations with `#[deriving(Hash)]`
* adds `Hash` back to `std::prelude`
* minor cleanup of whitespace and variable names.
2014-02-25 06:41:36 -08:00
Brendan Zabarauskas
3cc95314c3 Remove std::default::Default from the prelude 2014-02-24 21:22:26 -08:00
Erick Tryzelaar
f12ff1964b std: minor whitespace cleanup 2014-02-24 19:52:29 -08:00
Alex Crichton
6485917d7c Move extra::json to libserialize
This also inverts the dependency between libserialize and libcollections.

cc #8784
2014-02-24 09:51:39 -08:00
Alex Crichton
8761f79485 Remove deriving(ToStr)
This has been superseded by deriving(Show).

cc #9806
2014-02-24 00:15:17 -08:00
Alex Crichton
b78b749810 Remove all ToStr impls, add Show impls
This commit changes the ToStr trait to:

    impl<T: fmt::Show> ToStr for T {
        fn to_str(&self) -> ~str { format!("{}", *self) }
    }

The ToStr trait has been on the chopping block for quite awhile now, and this is
the final nail in its coffin. The trait and the corresponding method are not
being removed as part of this commit, but rather any implementations of the
`ToStr` trait are being forbidden because of the generic impl. The new way to
get the `to_str()` method to work is to implement `fmt::Show`.

Formatting into a `&mut Writer` (as `format!` does) is much more efficient than
`ToStr` when building up large strings. The `ToStr` trait forces many
intermediate allocations to be made while the `fmt::Show` trait allows
incremental buildup in the same heap allocated buffer. Additionally, the
`fmt::Show` trait is much more extensible in terms of interoperation with other
`Writer` instances and in more situations. By design the `ToStr` trait requires
at least one allocation whereas the `fmt::Show` trait does not require any
allocations.

Closes #8242
Closes #9806
2014-02-23 20:51:56 -08:00
Huon Wilson
efaf4db24c Transition to new Hash, removing IterBytes and std::to_bytes. 2014-02-24 07:44:10 +11:00
Alex Crichton
2a14e084cf 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.
2014-02-23 00:35:11 -08:00
bors
2fa7d6b44f auto merge of #12415 : HeroesGrave/rust/move-enum-set, r=alexcrichton
Part of #8784

Also removed the one glob import.
2014-02-21 05:26:58 -08:00
Liigo Zhuang
53b9d1a324 move extra::test to libtest 2014-02-20 16:03:58 +08:00
HeroesGrave
5bf8d3289f move enum_set to libcollections. #8784 2014-02-20 19:38:01 +13:00
Brendan Zabarauskas
cf0654c47c Improve naming of tuple getters, and add mutable tuple getter
Renames the `n*` and `n*_ref` tuple getters to `val*` and `ref*` respectively, and adds `mut*` getters.
2014-02-17 00:57:56 +11:00
bors
6b025c803c auto merge of #12272 : alexcrichton/rust/snapshot, r=kballard
This notably contains the `extern mod` => `extern crate` change.

Closes #9880
2014-02-15 14:06:26 -08:00
Corey Richardson
49e11630fa std: clean up ptr a bit 2014-02-15 12:11:41 -05:00
Alex Crichton
a41b0c2529 extern mod => extern crate
This was previously implemented, and it just needed a snapshot to go through
2014-02-14 22:55:21 -08:00
lpy
665555d58f return value/use extra::test::black_box in benchmarks 2014-02-14 07:45:34 -08:00
Michael Darakananda
bf1464c413 Removed num::Orderable 2014-02-13 20:12:59 -05:00
Nif Ward
184367093f Includes new add method that uses .clone() for support.
Added new tests for bsearch methods and changed "add" to "insert"

Fixed failure on div_floor.
2014-02-11 15:59:33 -05:00
bors
38ed4674e8 auto merge of #11956 : edwardw/rust/issue-7556, r=cmr
Closes #7556.

Also move ``std::util::Void`` to ``std::any::Void``. It makes more sense to me.
2014-02-10 14:56:47 -08:00
Edward Wang
e9ff91e9be Move replace and swap to std::mem. Get rid of std::util
Also move Void to std::any, move drop to std::mem and reexport in
prelude.
2014-02-11 05:21:35 +08:00
Bruno de Oliveira Abinader
cb1fad3b28 Implement List's any() function
This is needed for cases where we only need to know if a list item
matches the given predicate (eg. in Servo, we need to know if attributes
from different DOM elements are equal).
2014-02-10 08:36:48 -04:00
bors
d0affa5c8d auto merge of #12131 : brunoabinader/rust/list-find-doc-typo, r=alexcrichton
Replace ```v``` with ```ls```.
2014-02-09 18:46:28 -08:00
Bruno de Oliveira Abinader
66c036c293 Fixed a typo in list's find() documentation. 2014-02-09 12:45:54 -04:00
Brian Anderson
c7710cdf45 std: Add move_val_init to mem. Replace direct intrinsic usage 2014-02-09 00:17:41 -08:00
HeroesGrave
d81bb441da moved collections from libextra into libcollections 2014-02-07 19:49:26 +13:00