about summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2016-07-31Don't gate methods `Fn(Mut,Once)::call(mut,once)` with feature ↵Vadim Petrochenkov-1/+0
`unboxed_closures` They are already gated with feature `fn_traits`
2016-07-30Rewrite `slice::chunks` doc example to not require printing.Corey Farwell-9/+7
2016-07-30Rollup merge of #35104 - frewsxcv:linked-list-append, r=steveklabnikManish Goregaokar-11/+14
Rewrite `collections::LinkedList::append` doc example. None
2016-07-29Rollup merge of #35050 - knight42:improve-fmt-doc, r=steveklabnikGuillaume Gomez-13/+7
More intuitive explantion of strings formatting
2016-07-28Rewrite `collections::LinkedList::append` doc example.Corey Farwell-11/+14
2016-07-28Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichtonbors-0/+9
Escape fewer Unicode codepoints in `Debug` impl of `str` Use the same procedure as Python to determine whether a character is printable, described in [PEP 3138]. In particular, this means that the following character classes are escaped: - Cc (Other, Control) - Cf (Other, Format) - Cs (Other, Surrogate), even though they can't appear in Rust strings - Co (Other, Private Use) - Cn (Other, Not Assigned) - Zl (Separator, Line) - Zp (Separator, Paragraph) - Zs (Separator, Space), except for the ASCII space `' '` `0x20` This allows for user-friendly inspection of strings that are not English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`). Fixes #34318. CC #34422. [PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-28Auto merge of #34951 - tomgarcia:covariant-vec, r=brsonbors-5/+6
Make vec::Drain and binary_heap::Drain covariant I removed all mutable pointers/references, and added covariance tests similar to the ones in #32635. It builds and passes the tests, but I noticed that there weren't any tests of Drain's behaviour (at least not in libcollectionstest), so I'm not sure if my changes accidently broke Drain's behaviour. Should I add some tests for that (and if so, what should the tests include)?
2016-07-28Rename `char::escape` to `char::escape_debug` and add tracking issueTobias Bucher-4/+4
2016-07-27implement `From<Vec<char>>` and `From<&'a [char]>` for `String`Paul Woolcock-0/+20
Though there are ways to convert a slice or vec of chars into a string, it would be nice to be able to just do `String::from(['a', 'b', 'c'])`, so this PR implements `From<Vec<char>>` and `From<&'a [char]>` for String.
2016-07-26Rollup merge of #35019 - frewsxcv:slice-split, r=GuillaumeGomezSteve Klabnik-6/+31
Rewrite/expansion of `slice::split` doc examples. None
2016-07-26Rollup merge of #34974 - abhijeetbhagat:patch-2, r=GuillaumeGomezSteve Klabnik-0/+16
Update VecDeque documentation to specify direction of index 0 (#34920) I mentioned the direction for all the methods that work with an index
2016-07-27Fix #35031Knight-13/+7
2016-07-26Restore `char::escape_default` and add `char::escape` insteadTobias Bucher-0/+9
2016-07-25Rewrite/expansion of `slice::split` doc examples.Corey Farwell-6/+31
2016-07-24Rollup merge of #34989 - frewsxcv:fix-set-len-doc-example, r=nagisaManish Goregaokar-3/+4
Fix incorrect 'memory leak' example for `Vec::set_len`. Example was written in https://github.com/rust-lang/rust/pull/34911 Issue was brought up in this comment: https://github.com/rust-lang/rust/commit/a005b2cd2ac679da7393e537aa05e2b7d32d36d5#commitcomment-18346958
2016-07-24Rollup merge of #34988 - frewsxcv:vec-windows, r=GuillaumeGomezManish Goregaokar-7/+14
Doc example improvements for `slice::windows`. * Modify existing example to not rely on printing to see results * Add an example demonstrating when slice is shorter than `size`
2016-07-23Doc example improvements for `slice::windows`.Corey Farwell-7/+14
* Modify existing example to not rely on printing to see results * Add an example demonstrating when slice is shorter than `size`
2016-07-23Fix incorrect 'memory leak' example for `Vec::set_len`.Corey Farwell-3/+4
Example was written in https://github.com/rust-lang/rust/pull/34911 Issue was brought up in this comment: https://github.com/rust-lang/rust/commit/a005b2cd2ac679da7393e537aa05e2b7d32d36d5#commitcomment-18346958
2016-07-22Update VecDeque documentation to specify direction of index 0 (#34920)abhi-0/+16
2016-07-22Auto merge of #34771 - murarth:string-insert-str, r=alexcrichtonbors-9/+53
Add method `String::insert_str`
2016-07-21Readding lifetime parameters and removing allocationThomas Garcia-28/+49
2016-07-21Auto merge of #34544 - ↵bors-2/+4
3Hren:issue/xx/reinterpret-format-precision-for-strings, r=alexcrichton feat: reinterpret `precision` field for strings This commit changes the behavior of formatting string arguments with both width and precision fields set. Documentation says that the `width` field is the "minimum width" that the format should take up. If the value's string does not fill up this many characters, then the padding specified by fill/alignment will be used to take up the required space. This is true for all formatted types except string, which is truncated down to `precision` number of chars and then all of `fill`, `align` and `width` fields are completely ignored. For example: `format!("{:/^10.8}", "1234567890);` emits "12345678". In the contrast Python version works as the expected: ```python >>> '{:/^10.8}'.format('1234567890') '/12345678/' ``` This commit gives back the `Python` behavior by changing the `precision` field meaning to the truncation and nothing more. The result string *will* be prepended/appended up to the `width` field with the proper `fill` char. __However, this is the breaking change, I admit.__ Feel free to close it, but otherwise it should be mentioned in the `std::fmt` documentation somewhere near of `fill/align/width` fields description.
2016-07-21Rollup merge of #34930 - frewsxcv:vec-as-slice, r=steveklabnikGuillaume Gomez-0/+16
Add doc examples for `Vec::{as_slice,as_mut_slice}`. None
2016-07-21Rollup merge of #34919 - GuillaumeGomez:btree_map_doc, r=steveklabnikGuillaume Gomez-2/+189
Add doc for btree_map types Part of #29348. r? @steveklabnik
2016-07-21Rollup merge of #34911 - frewsxcv:vec-set-len, r=steveklabnikGuillaume Gomez-2/+30
Rewrite/expand doc examples for `Vec::set_len`. None
2016-07-21Rollup merge of #34890 - oconnor663:addassign, r=brsonGuillaume Gomez-1/+9
implement AddAssign for String Currently `String` implements `Add` but not `AddAssign`. This PR fills in that gap. I played around with having `AddAssign` (and `Add` and `push_str`) take `AsRef<str>` instead of `&str`, but it looks like that breaks arguments that implement `Deref<Target=str>` and not `AsRef<str>`. Comments in [`libcore/convert.rs`](https://github.com/rust-lang/rust/blob/master/src/libcore/convert.rs#L207-L213) make it sound like we could fix this with a blanket impl eventually. Does anyone know what's blocking that?
2016-07-21Rollup merge of #34855 - GuillaumeGomez:vec_deque_doc, r=steveklabnikGuillaume Gomez-1/+71
Add examples for VecDeque Part of #29348. r? @steveklabnik
2016-07-21Rollup merge of #34854 - GuillaumeGomez:linked_list_doc, r=steveklabnikGuillaume Gomez-9/+65
Add examples for LinkedList Part of #29348. r? @steveklabnik
2016-07-21Make vec::Drain and binary_heap::Drain covariantThomas Garcia-48/+28
2016-07-20Add doc for btree_map typesggomez-2/+189
2016-07-19Add doc examples for `Vec::{as_slice,as_mut_slice}`.Corey Farwell-0/+16
2016-07-19Auto merge of #34885 - GuillaumeGomez:btree_map_debug, r=alexcrichtonbors-0/+33
Add debug for btree_map::{Entry, VacantEntry, OccupiedEntry}
2016-07-19Rewrite/expand doc examples for `Vec::set_len`.Corey Farwell-2/+30
2016-07-19Add debug for btree_map::{Entry, VacantEntry, OccupiedEntry}Guillaume Gomez-0/+33
2016-07-18use a new feature name for String AddAssignJack O'Connor-1/+1
2016-07-18update the since field to 1.12.0 for String AddAssignJack O'Connor-1/+1
2016-07-18Rollup merge of #34884 - shepmaster:from_raw_parts_doc, r=@nagisaSeo Sanghyeon-1/+13
Improve {String,Vec}::from_raw_parts documentation
2016-07-18Rollup merge of #34853 - frewsxcv:vec-truncate, r=GuillaumeGomezSeo Sanghyeon-1/+28
Partial rewrite/expansion of `Vec::truncate` documentation. None
2016-07-17Remove extraneous wordsJake Goulding-1/+1
2016-07-17Document from_raw_parts involves ownership transferJake Goulding-0/+12
2016-07-17implement AddAssign for StringJack O'Connor-1/+9
2016-07-16Remove unnecessary indexing and deref in `Vec::as_mut_slice`.Corey Farwell-1/+1
2016-07-17Add examples for LinkedListGuillaume Gomez-9/+65
2016-07-16Add examples for VecDequeGuillaume Gomez-1/+71
2016-07-16Partial rewrite/expansion of `Vec::truncate` documentation.Corey Farwell-1/+28
2016-07-14Mention where `std::vec` structs originate from.Corey Farwell-0/+11
2016-07-13Auto merge of #34608 - apasel422:ll, r=blussbors-352/+283
Replace `LinkedList`'s use of `Box` with `Shared` Closes #34417
2016-07-11Add method `String::insert_str`Murarth-9/+53
2016-07-11Auto merge of #34725 - GuillaumeGomez:doc_slice, r=steveklabnikbors-9/+236
Improve slice docs Fixes #29337. r? @steveklabnik
2016-07-09Auto merge of #34745 - alexandermerritt:slice-doc, r=brsonbors-1/+1
make docs for clone_from_slice consistent with copy_from_slice What 'this slice' refers to is not intuitive, given this method can appear in other places, e.g. in docs for Vec.