about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2014-02-13Move base64 and hex from libextra to libserializeLiigo Zhuang-577/+0
2014-02-12Adds support for working with URL PathsYehuda Katz-0/+115
It is sometimes useful to parse just the path portion of a URL (path, query string and fragment) rather than the entire URL.
2014-02-11Rewrite channels yet again for upgradeabilityAlex Crichton-7/+7
This, the Nth rewrite of channels, is not a rewrite of the core logic behind channels, but rather their API usage. In the past, we had the distinction between oneshot, stream, and shared channels, but the most recent rewrite dropped oneshots in favor of streams and shared channels. This distinction of stream vs shared has shown that it's not quite what we'd like either, and this moves the `std::comm` module in the direction of "one channel to rule them all". There now remains only one Chan and one Port. This new channel is actually a hybrid oneshot/stream/shared channel under the hood in order to optimize for the use cases in question. Additionally, this also reduces the cognitive burden of having to choose between a Chan or a SharedChan in an API. My simple benchmarks show no reduction in efficiency over the existing channels today, and a 3x improvement in the oneshot case. I sadly don't have a pre-last-rewrite compiler to test out the old old oneshots, but I would imagine that the performance is comparable, but slightly slower (due to atomic reference counting). This commit also brings the bonus bugfix to channels that the pending queue of messages are all dropped when a Port disappears rather then when both the Port and the Chan disappear.
2014-02-11Factoring bigint, rational, and complex out of libextra into libnum.Felix S. Klock II-3692/+0
Removed use of globs present in earlier versions of modules. Fix tutorial.md to reflect `extra::rational` ==> `num::rational`.
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-4/+5
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-08auto merge of #12105 : huonw/rust/bench-black-box, r=alexcrichtonbors-3/+15
This allows a result to be marked as "used" by passing it to a function LLVM cannot see inside (unless LTO is enabled). Closes #8261.
2014-02-09extra::test: add an opaque function to assist with accurateHuon Wilson-3/+15
benchmarking. This allows a result to be marked as "used" by passing it to a function LLVM cannot see inside. By making `iter` generic and using this `black_box` on the result benchmarks can get this behaviour simply by returning their computation.
2014-02-08auto merge of #12098 : kballard/rust/from_utf8_lossy_tweak, r=huonwbors-2/+2
MaybeOwned allows from_utf8_lossy to avoid allocation if there are no invalid bytes in the input. Before: ``` test str::bench::from_utf8_lossy_100_ascii ... bench: 183 ns/iter (+/- 5) test str::bench::from_utf8_lossy_100_invalid ... bench: 341 ns/iter (+/- 15) test str::bench::from_utf8_lossy_100_multibyte ... bench: 227 ns/iter (+/- 13) test str::bench::from_utf8_lossy_invalid ... bench: 102 ns/iter (+/- 4) test str::bench::is_utf8_100_ascii ... bench: 2 ns/iter (+/- 0) test str::bench::is_utf8_100_multibyte ... bench: 2 ns/iter (+/- 0) ``` Now: ``` test str::bench::from_utf8_lossy_100_ascii ... bench: 96 ns/iter (+/- 4) test str::bench::from_utf8_lossy_100_invalid ... bench: 318 ns/iter (+/- 10) test str::bench::from_utf8_lossy_100_multibyte ... bench: 105 ns/iter (+/- 2) test str::bench::from_utf8_lossy_invalid ... bench: 105 ns/iter (+/- 2) test str::bench::is_utf8_100_ascii ... bench: 2 ns/iter (+/- 0) test str::bench::is_utf8_100_multibyte ... bench: 2 ns/iter (+/- 0) ```
2014-02-07Delete send_str, rewrite clients on top of MaybeOwned<'static>Kevin Ballard-2/+2
Declare a `type SendStr = MaybeOwned<'static>` to ease readibility of types that needed the old SendStr behavior. Implement all the traits for MaybeOwned that SendStr used to implement.
2014-02-08extra::json: remove the use of `unsafe` char transmutes.Huon Wilson-139/+139
Avoid using -1 as a char sentinel, when Option<char> is the perfect thing.
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-7811/+12
2014-02-06getopts: unify testsArcterus-1/+1
2014-02-06getopts: replaced base functions with those from groupArcterus-13/+12
2014-02-06Move getopts out of extraArcterus-1706/+1
2014-02-06auto merge of #12001 : yuriks/rust/getopts-tweaks, r=brsonbors-0/+64
This complements `usage` by auto-generating a short one-liner summary of the options. (First timer here, be gentle... :)
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-2007/+145
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-05move concurrent stuff from libextra to libsyncJeremyLetang-3829/+8
2014-02-04auto merge of #11230 : csherratt/rust/cow, r=alexcrichtonbors-0/+108
This allows patch adds a new arc type that allows for creation of copy-on-write data structures. The idea is that it is safe to mutate any data structure as long as it has only one reference to it. If there are multiple, it requires cloning of the data structure before mutation is possible.
2014-02-04auto merge of #12026 : alexcrichton/rust/snapshots, r=cmrbors-5/+0
2014-02-04auto merge of #11951 : dmanescu/rust/reserve-rename, r=huonwbors-15/+19
Changes in std::{str,vec,hashmap} and extra::{priority_queue,ringbuf}. Fixes #11949
2014-02-04Register new snapshotsAlex Crichton-5/+0
2014-02-04extra: Move uuid to libuuidBirunthan Mohanathas-829/+0
cc #8784
2014-02-04Rename reserve to reserve_exact and reserve_at_least to reserveDavid Manescu-15/+19
Changes in std::{str,vec,hashmap} and extra::{priority_queue,ringbuf}. Fixes #11949
2014-02-03auto merge of #12016 : FlaPer87/rust/remove-non-copyable, r=alexcrichtonbors-9/+9
cc #10834
2014-02-04Replace NonCopyable usage with NoPodFlavio Percoco-9/+9
cc #10834
2014-02-03auto merge of #12012 : omasanori/rust/semver, r=alexcrichtonbors-424/+0
Done as a part of #8784.
2014-02-03Various bug fixes and rebase conflictsAlex Crichton-12/+5
2014-02-03extra: Introduce a mutex type for native/green threadsAlex Crichton-0/+564
2014-02-03extra: Re-add the Once primitve to extra::syncAlex Crichton-0/+168
This originally lived in std::unstable::mutex, but now it has a new home (and a more proper one).
2014-02-03extra: Add an intrusive MPSC to be used soonAlex Crichton-0/+139
2014-02-03extra: Make room for more sync primitivesAlex Crichton-20/+28
2014-02-03extra: Fix tests with io_error usageAlex Crichton-26/+27
2014-02-03extra: Remove io_error usageAlex Crichton-206/+277
2014-02-03Move semver out of libextra.OGINO Masanori-424/+0
Done as a part of #8784. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-02-02Move term, terminfo out of extra.xales-1434/+2
cc #8784
2014-02-02Add `extra::getopts::short_usage`Yuri Kunde Schlesner-0/+64
This complements `usage` by auto-generating a short one-liner summary of the options.
2014-02-01auto merge of #11974 : huonw/rust/no-at-vec, r=pcwaltonbors-34/+1
This removes @[] from the parser as well as much of the handling of it (and `@str`) from the compiler as I can find. I've just rebased @pcwalton's (already reviewed) `@str` removal (and fixed the problems in a separate commit); the only new work is the trailing commits with my authorship. Closes #11967
2014-02-02std,extra: remove use of & support for @[].Huon Wilson-22/+1
2014-02-01auto merge of #11944 : nathanielherman/rust/vec_opt, r=alexcrichtonbors-2/+2
Closes #11733
2014-02-02libextra: Remove `@str` from all the librariesPatrick Walton-12/+0
2014-01-31Fix minor doc typosVirgile Andreani-4/+4
2014-01-31Introduce marker types for indicating variance and for opting outNiko Matsakis-8/+14
of builtin bounds. Fixes #10834. Fixes #11385. cc #5922.
2014-01-30Make pop_ref and mut_pop_ref return Option instead of failing on empty vectorsNathaniel Herman-1/+1
2014-01-30Make shift_ref and mut_shift_ref return Option instead of failingNathaniel Herman-1/+1
2014-01-30auto merge of #11895 : xales/rust/libstd, r=alexcrichtonbors-6/+4
Fixes #11814
2014-01-30Remove Times traitBrendan Zabarauskas-59/+59
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal was then lost after `do` was disabled for closures. It's time to let this one go.
2014-01-29Remove seldom-used std::reference functions.xales-6/+4
2014-01-29Rename std::borrow to std::reference.xales-4/+4
Fixes #11814
2014-01-29auto merge of #11868 : bytbox/rust/remove-do, r=alexcrichtonbors-123/+122
Fixes #10815.
2014-01-29Removing do keyword from libextraScott Lawrence-123/+122