about summary refs log tree commit diff
path: root/src/libextra
AgeCommit message (Collapse)AuthorLines
2013-06-16Remove moves from *T and implement in another wayNiko Matsakis-1/+1
2013-06-16Add copies to type params with Copy boundNiko Matsakis-39/+40
2013-06-16auto merge of #7160 : kballard/rust/terminfo-parm-i-fix, r=thestingerbors-3/+14
My latest terminfo work introduced a bug in the handling of %i, which was noticed by @huonw after the PR was already merged in. r? @thestinger
2013-06-16auto merge of #7123 : huonw/rust/more-str, r=thestingerbors-20/+2
Moves all the remaining functions that could reasonably be methods to be methods, except for some FFI ones (which I believe @erickt is working on, possibly) and `each_split_within`, since I'm not really sure the details of it (I believe @kimundi wrote the current implementation, so maybe he could convert it to an external iterator method on `StrSlice`, e.g. `word_wrap_iter(&self) -> WordWrapIterator<'self>`, where `WordWrapIterator` impls `Iterator<&'self str>`. It probably won't be too hard, since it's already a state machine.) This also cleans up the comparison impls for the string types, except I'm not sure how the lang items `eq_str` and `eq_str_uniq` need to be handled, so they (`eq_slice` and `eq`) remain stand-alone functions.
2013-06-16remove unused importsHuon Wilson-18/+1
2013-06-15rm vec::uniq_lenDaniel Micay-17/+14
2013-06-16std: continue improving the comparison trait impls for str.Huon Wilson-2/+1
This moves them all into the traits submodule, and delegates Ord to the TotalOrd instance. It also deletes the stand-alone lt, gt, ge and le functions.
2013-06-15Fix terminfo::param %i opKevin Ballard-3/+14
2013-06-15auto merge of #7109 : bblum/rust/rwlocks, r=brsonbors-86/+221
r? @brson links to issues: #7065 the race that's fixed; #7066 the perf improvement I added. There are also some minor cleanup commits here. To measure the performance improvement from replacing the exclusive with an atomic uint, I edited the ```msgsend-ring-rw-arcs``` bench test to do a ```write_downgrade``` instead of just a ```write```, so that it stressed the code paths that accessed ```read_count```. (At first I was still using ```write``` and saw no performance difference whatsoever, whoooops.) The bench test measures how long it takes to send 1,000,000 messages by using rwarcs to emulate pipes. I also measured the performance difference imposed by the fix to the ```access_lock``` race (which involves taking an extra semaphore in the ```cond.wait()``` path). The net result is that fixing the race imposes a 4% to 5% slowdown, but doing the atomic uint optimization gives a 6% to 8% speedup. Note that this speedup will be most visible in read- or downgrade-heavy workloads. If an RWARC's only users are writers, the optimization doesn't matter. All the same, I think this more than justifies the extra complexity I mentioned in #7066. The raw numbers are: ``` with xadd read count before write_cond fix 4.18 to 4.26 us/message with write_cond fix 4.35 to 4.39 us/message with exclusive read count before write_cond fix 4.41 to 4.47 us/message with write_cond fix 4.65 to 4.76 us/message ```
2013-06-15auto merge of #7133 : kballard/rust/terminfo-parm, r=thestingerbors-97/+321
Implement conditional support in terminfo, along with a few other related operators. Fix implementation of non-commutative arithmetic operators. Remove all known cases of task failure from `terminfo::parm::expand`, and change the method signature. Fix some other miscellaneous issues.
2013-06-14rm MutableIterDaniel Micay-1/+1
replaced with mutable implementations of Iterator
2013-06-14add IteratorUtil to the preludeDaniel Micay-20/+2
2013-06-14Fix line lengths in terminfoKevin Ballard-6/+12
2013-06-14Implement terminfo param conditionalsKevin Ballard-18/+129
Implement the %?, %t, %e, and %; operators. Also implement the %<, %=, %> operators, without which conditionals aren't very useful. Fix the order of parameters for the arithmetic operators. Implement the missing %^ operator.
2013-06-14Fix a bunch of failure cases in terminfoKevin Ballard-84/+161
Replace all potentially-failing operations with Err returns and add tests. Remove the Char parameter type; characters are represented as Numbers. Fix integer constants to work properly when there are multiple constants in the same capability string. Tweak loop to use iterators instead of indexing into cap.
2013-06-14Don't require &mut [Param] with terminfo::parm::expand()Kevin Ballard-7/+11
2013-06-14Tweak terminfo::parm::expand function signatureKevin Ballard-16/+27
Take a new struct Variables instead of two &mut [] vectors for static and dynamic variables.
2013-06-14Tweak new terminfo logical operator supportKevin Ballard-27/+12
2013-06-14Various terminfo parameterization changesCorey Richardson-4/+34
2013-06-13Revert "std: convert {vec,str}::to_owned to methods."Brian Anderson-27/+28
This fixes the strange random crashes in compile-fail tests. This reverts commit 96cd61ad034cc9e88ab6a7845c3480dbc1ea62f3. Conflicts: src/librustc/driver/driver.rs src/libstd/str.rs src/libsyntax/ext/quote.rs
2013-06-13Improve comments in sync and arc a bit more.Ben Blum-7/+9
2013-06-13Change sync::RWlock implementation to use atomic uint instead of exclusive, ↵Ben Blum-57/+80
for performance. Close #7066.
2013-06-13Add a test case for #7065.Ben Blum-0/+62
2013-06-13Thread order_lock through rwlock condvars for reacquiring access_lock. Fixes ↵Ben Blum-22/+72
#7065.
2013-06-12remove bitrotted cant_nest field from RWARC (the #[mutable] tag suffices)Ben Blum-3/+1
2013-06-12std: generalise .trim_chars to use CharEq.Huon Wilson-1/+1
2013-06-12std: convert str::replace to a method.Huon Wilson-2/+1
2013-06-12std: remove substr & str::count_*, methodise char_len, implement slice_chars.Huon Wilson-15/+15
The confusing mixture of byte index and character count meant that every use of .substr was incorrect; replaced by slice_chars which only uses character indices. The old behaviour of `.substr(start, n)` can be emulated via `.slice_from(start).slice_chars(0, n)`.
2013-06-12std: unify the str -> [u8] functions as 3 methods: .as_bytes() and ↵Huon Wilson-42/+37
.as_bytes_with_null[_consume](). The first acts on &str and is not nul-terminated, the last two act on strings that are always null terminated (&'static str, ~str and @str).
2013-06-12std: convert str::repeat to a method.Huon Wilson-3/+3
2013-06-12std: convert {vec,str}::to_owned to methods.Huon Wilson-27/+27
2013-06-11auto merge of #7055 : thestinger/rust/iterator, r=catamorphismbors-13/+14
This was a lot more painful than just changing `x.each` to `x.iter().advance` . I ran into my old friend #5898 and had to add underscores to some method names as a temporary workaround. The borrow checker also had other ideas because rvalues aren't handled very well yet so temporary variables had to be added. However, storing the temporary in a variable led to dynamic `@mut` failures, so those had to be wrapped in blocks except where the scope ends immediately. Anyway, the ugliness will be fixed as the compiler issues are fixed and this change will amount to `for x.each |x|` becoming `for x.iter |x|` and making all the iterator adaptors available. I dropped the run-pass tests for `old_iter` because there's not much point in fixing a module that's on the way out in the next week or so.
2013-06-11option: remove redundant old_iter implsDaniel Micay-13/+14
2013-06-11auto merge of #7035 : influenza/rust/getopts-doc-update, r=bstriebors-14/+15
The documentation was still refering to getopts as though it was in the std module - I've changed this to refer to extra instead.
2013-06-11auto merge of #7047 : bblum/rust/bug_triage, r=graydonbors-1/+0
r? anybody
2013-06-11extra: implement .norm(), and Polar conversion functions for complex numbers.Huon Wilson-14/+63
Also, convert complex to use Clone, rather than Copy. Fixes #5734 and #5735.
2013-06-10terminfo: Support more terminfo directory structuresKevin Ballard-2/+13
OS X's terminfo uses the hex representation of the first character of the terminal name as the directory name. Ubuntu seems to use /lib/terminfo instead of /usr/share/terminfo, at least on the one machine I have access to.
2013-06-10Remove 'this could be clearer' FIXME. Looks fine. Close #2618.Ben Blum-1/+0
2013-06-11fix tests, remove some warningsHuon Wilson-5/+2
2013-06-11std: replace str::{starts,ends}_with with the method.Huon Wilson-5/+5
2013-06-11std: replace str::substr with the method.Huon Wilson-3/+3
2013-06-10std: remove str::{connect,concat}*.Huon Wilson-7/+7
2013-06-10clean-up unused import warningsHuon Wilson-2/+0
2013-06-10std: convert str::char_at* to methods.Huon Wilson-13/+12
2013-06-10std: convert str::trim* to methods.Huon Wilson-1/+1
2013-06-10std: convert str::reserve* to methods, and methodise str::push_*.Huon Wilson-42/+40
2013-06-10std: remove str::contains in favour of the methodHuon Wilson-8/+8
2013-06-10std: replace str::find_str* with a methodHuon Wilson-2/+2
2013-06-10std: replace str::{any,all}_between with the iterator equivalent.Huon Wilson-3/+2
2013-06-10std: remove str::{len, slice, is_empty} in favour of methods.Huon Wilson-40/+37