about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2013-08-09auto merge of #8387 : brson/rust/nooldrt, r=brsonbors-14/+15
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-14/+15
2013-08-09Remove redundant Ord method impls.OGINO Masanori-3/+0
Basically, generic containers should not use the default methods since a type of elements may not guarantees total order. str could use them since u8's Ord guarantees total order. Floating point numbers are also broken with the default methods because of NaN. Thanks for @thestinger. Timespec also guarantees total order AIUI. I'm unsure whether extra::semver::Identifier does so I left it alone. Proof needed. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-08Isolate common wait_end logicSteven Stewart-Gallus-13/+13
2013-08-08Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-365/+410
remove-str-trailing-nulls
2013-08-08auto merge of #8385 : cmr/rust/big-rollup, r=alexcrichtonbors-342/+373
This is a fairly large rollup, but I've tested everything locally, and none of it should be platform-specific. r=alexcrichton (bdfdbdd) r=brson (d803c18) r=alexcrichton (a5041d0) r=bstrie (317412a) r=alexcrichton (135c85e) r=thestinger (8805baa) r=pcwalton (0661178) r=cmr (9397fe0) r=cmr (caa4135) r=cmr (6a21d93) r=cmr (4dc3379) r=cmr (0aa5154) r=cmr (18be261) r=thestinger (f10be03)
2013-08-08extra::dlist: Use iterator::order for sequence orderingblake2-ppc-3/+61
2013-08-07extra: Remove all each_* methods in treemapblake2-ppc-39/+6
.each_key(), .each_value() and the other methods are replaced by .iter() and .rev_iter(), and restrictions of those iterators.
2013-08-07extra: Implement .rev_iter() in treemapblake2-ppc-21/+60
Implement reverse iterators for TreeMap and TreeSet, that produce the keys in backward order.
2013-08-07extra: External iterators for TreeSet set operationsblake2-ppc-114/+134
Write external iterators for Difference, Sym. Difference, Intersection and Union set operations. These iterators are generic insofar that they could work on any ordered sequence iterators, even though they are type specialized to the TreeSetIterator in this case. Looking at the `check` function in the treeset tests, rustc seems unwilling to compile a function resembling:: fn check<'a, T: Iterator<&'a int>>(... ) so the tests for these iterators are still running the legacy loop protocol.
2013-08-07extra: Simplify Eq/Ord in treemapblake2-ppc-21/+5
Write the Eq and Ord impls for TreeMap in a more straightforward way using iterator::Zip
2013-08-07extra: add `internal` to {de,in}flate_bytes_ naming to address nitdarkf-6/+6
2013-08-07add extra::flate::deflate_bytes_zlib and a testdarkf-2/+19
2013-08-07add inflate_bytes_zlib to exra::flatedarkf-2/+11
2013-08-07Turn OptGroups into a main opt and a main and an aliased optsJordi Boggiano-35/+72
This way opt_present("apple") will match no matter if the user passed -a or --apple
2013-08-07Add missing getopts::groups::optflagmulti functionJordi Boggiano-0/+14
2013-08-07Forbid `priv` where it has no effectAlex Crichton-33/+33
This is everywhere except struct fields and enum variants.
2013-08-07std: Fix for-range loops that can use iteratorsblake2-ppc-34/+21
Fix inappropriate for-range loops to use for-iterator constructs (or other appropriate solution) instead.
2013-08-07extra: Remove all .each methods in smallintmapblake2-ppc-43/+0
2013-08-07auto merge of #8358 : brson/rust/newrt, r=brsonbors-0/+3
2013-08-07Disable linked failure testsBrian Anderson-0/+3
The implementation currently contains a race that leads to segfaults.
2013-08-07auto merge of #8320 : mihneadb/rust/freq_count, r=cmrbors-0/+11
2013-08-07Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-446/+265
remove-str-trailing-nulls
2013-08-07auto merge of #8294 : erickt/rust/map-move, r=bblumbors-23/+23
According to #7887, we've decided to use the syntax of `fn map<U>(f: &fn(&T) -> U) -> U`, which passes a reference to the closure, and to `fn map_move<U>(f: &fn(T) -> U) -> U` which moves the value into the closure. This PR adds these `.map_move()` functions to `Option` and `Result`. In addition, it has these other minor features: * Replaces a couple uses of `option.get()`, `result.get()`, and `result.get_err()` with `option.unwrap()`, `result.unwrap()`, and `result.unwrap_err()`. (See #8268 and #8288 for a more thorough adaptation of this functionality. * Removes `option.take_map()` and `option.take_map_default()`. These two functions can be easily written as `.take().map_move(...)`. * Adds a better error message to `result.unwrap()` and `result.unwrap_err()`.
2013-08-07auto merge of #8326 : thestinger/rust/iterator, r=alexcrichtonbors-332/+1
The `extra::iter` module wasn't actually included in `extra.rs` when it was moved from `std`... I assume no one is going to miss it.
2013-08-07Add frequency count to extra::stat. #8281Mihnea Dobrescu-Balaur-0/+11
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-20/+20
2013-08-07std: add result.map_move, result.map_err_moveErick Tryzelaar-1/+1
2013-08-07option.get -> option.unwrapErick Tryzelaar-2/+2
2013-08-06remove `extra::iter`Daniel Micay-331/+0
This module provided adaptors for the old internal iterator protocol, but they proved to be quite unreadable and are not generic enough to handle borrowed pointers well. Since Rust no longer defines an internal iteration protocol, I don't think there's going to be any reuse via these adaptors.
2013-08-06Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-130/+375
remove-str-trailing-nulls
2013-08-06Merge commit 'd89ff7eef969aee6b493bc846b64d68358fafbcd' into ↵Erick Tryzelaar-57/+243
remove-str-trailing-nulls
2013-08-06iterator: rename `Counter::new` to `count`Daniel Micay-1/+1
to match the convention used by `range`, since `iterator::count` is already namespaced enough and won't be ambiguous
2013-08-06Result::get -> Result::unwrapSteven Fackler-6/+6
2013-08-06Removed convenience encoding trait implsSteven Fackler-154/+63
Encoding should really only be done from [u8]<->str. The extra convenience implementations don't really have a place, especially since they're so trivial. Also improved error messages in FromBase64.
2013-08-06Removing space for NULL terminatorSteven Fackler-2/+1
String NULL terminators are going away soon, so we may as well get rid of this now so it doesn't rot.
2013-08-06ToBase64 and ToHex perf improvementsSteven Fackler-37/+38
The overhead of str::push_char is high enough to cripple the performance of these two functions. I've switched them to build the output in a ~[u8] and then convert to a string later. Since we know exactly the bytes going into the vector, we can use the unsafe version to avoid the is_utf8 check. I could have riced it further with vec::raw::get, but it only added ~10MB/s so I didn't think it was worth it. ToHex is still ~30% slower than FromHex, which is puzzling. Before: ``` test base64::test::from_base64 ... bench: 1000 ns/iter (+/- 349) = 204 MB/s test base64::test::to_base64 ... bench: 2390 ns/iter (+/- 1130) = 63 MB/s ... test hex::tests::bench_from_hex ... bench: 884 ns/iter (+/- 220) = 341 MB/s test hex::tests::bench_to_hex ... bench: 2453 ns/iter (+/- 919) = 61 MB/s ``` After: ``` test base64::test::from_base64 ... bench: 1271 ns/iter (+/- 600) = 160 MB/s test base64::test::to_base64 ... bench: 759 ns/iter (+/- 286) = 198 MB/s ... test hex::tests::bench_from_hex ... bench: 875 ns/iter (+/- 377) = 345 MB/s test hex::tests::bench_to_hex ... bench: 593 ns/iter (+/- 240) = 254 MB/s ```
2013-08-06Some minor hex changesSteven Fackler-6/+8
2013-08-06Added hexadecimal encoding moduleSteven Fackler-0/+239
FromHex ignores whitespace and parses either upper or lower case hex digits. ToHex outputs lower case hex digits with no whitespace. Unlike ToBase64, ToHex doesn't allow you to configure the output format. I don't feel that it's super useful in this case.
2013-08-06auto merge of #8312 : alexcrichton/rust/use-treemap, r=ericktbors-18/+1
Closes #4430
2013-08-06auto merge of #8054 : sammykim/rust/move-EnumSet, r=alexcrichtonbors-0/+289
Fix #8004
2013-08-06Move EnumSet into libextraSangeun Kim-0/+289
2013-08-06std: Remove uint::iterate, replaced by `range`blake2-ppc-4/+3
2013-08-06extra: Simplify the bitv iterators using Repeatblake2-ppc-44/+19
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-64/+63
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-05Use TreeMap's ord implementation for JsonAlex Crichton-18/+1
Closes #4430
2013-08-05auto merge of #8183 : omasanori/rust/migrate-new, r=sanxiynbors-22/+24
It seems that relatively new code uses `Foo::new()` instead of `Foo()` so I wrote a patch to migrate some structs to the former style. Is it a right direction? If there are any guidelines not to use new()-style, could you add them to the [style guide](https://github.com/omasanori/rust/wiki/Note-style-guide)?
2013-08-05auto merge of #8227 : dim-an/rust/tree-iter, r=thestingerbors-5/+147
2013-08-05Add extra::arena::Arena::new{, _with_size}.OGINO Masanori-22/+24
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-04auto merge of #8297 : brson/rust/dlist-dtor, r=brsonbors-4/+38
The compiler-generated dtor for DList recurses deeply to drop Nodes. For big lists this can overflow the stack. This is a problem for the new scheduler, where split stacks are not implemented. Thanks @blake2-ppc