about summary refs log tree commit diff
path: root/src/libstd/path.rs
AgeCommit message (Collapse)AuthorLines
2015-11-03Auto merge of #29514 - apasel422:issue-26220, r=alexcrichtonbors-0/+14
Closes #26220. r? @alexcrichton
2015-11-02std: Base Hash for Path on its iteratorAlex Crichton-3/+37
Almost all operations on Path are based on the components iterator in one form or another to handle equivalent paths. The `Hash` implementations, however, mistakenly just went straight to the underlying `OsStr`, causing these equivalent paths to not get merged together. This commit updates the `Hash` implementation to also be based on the iterator which should ensure that if two paths are equal they hash to the same thing. cc #29008, but doesn't close it
2015-11-01Implement `IntoIterator` for `&{Path, PathBuf}`Andrew Paseltiner-0/+14
Closes #26220.
2015-10-30run rustfmt on std::pathTshepang Lekhonkhobe-96/+165
There was a bunch of manual fixes too... rustfmt isn't quite there yet
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-1/+78
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-09-30Rollup merge of #28749 - tshepang:patch-6, r=blussManish Goregaokar-1/+0
2015-09-30path: remove a line of code that is not usefulTshepang Lekhonkhobe-1/+0
2015-09-30doc: fix typoTshepang Lekhonkhobe-1/+1
2015-09-09Reduce code bloat from conversion traits in function parametersVadim Petrochenkov-7/+40
2015-08-28Rollup merge of #28029 - tshepang:unusual, r=steveklabnikManish Goregaokar-2/+5
2015-08-27Auto merge of #28030 - tshepang:improve-example, r=alexcrichtonbors-2/+4
2015-08-26Make iter::order functions into methods on IteratorSteven Fackler-8/+8
This does cause some breakage due to deficiencies in resolve - `path::Components` is both an `Iterator` and implements `Eq`, `Ord`, etc. If one calls e.g. `partial_cmp` on a `Components` and passes a `&Components` intending to target the `PartialOrd` impl, the compiler will select the `partial_cmp` from `Iterator` and then error out. I doubt anyone will run into breakage from `Components` specifically, but we should see if there are third party types that will run into issues. `iter::order::equals` wasn't moved to `Iterator` since it's exactly the same as `iter::order::eq` but with an `Eq` instead of `PartialEq` bound, which doensn't seem very useful. I also updated `le`, `gt`, etc to use `partial_cmp` which lets us drop the extra `PartialEq` bound. cc #27737
2015-08-26doc: improve as_path exampleTshepang Lekhonkhobe-2/+4
2015-08-26path: the if-else block looked unusualTshepang Lekhonkhobe-2/+5
2015-08-15std: Add issues to all unstable featuresAlex Crichton-3/+6
2015-08-11rollup merge of #27678: alexcrichton/snapshotsAlex Crichton-9/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-11Register new snapshotsAlex Crichton-9/+0
* Lots of core prelude imports removed * Makefile support for MSVC env vars and Rust crates removed * Makefile support for morestack removed
2015-08-11Remove unneeded FIXMETobias Bucher-1/+0
2015-08-11Rollup merge of #27633 - tshepang:patch-6, r=alexcrichtonManish Goregaokar-1/+1
2015-08-10doc: add missing symbolTshepang Lekhonkhobe-1/+1
2015-08-09Replace many uses of `mem::transmute` with more specific functionsTobias Bucher-4/+4
The replacements are functions that usually use a single `mem::transmute` in their body and restrict input and output via more concrete types than `T` and `U`. Worth noting are the `transmute` functions for slices and the `from_utf8*` family for mutable slices. Additionally, `mem::transmute` was often used for casting raw pointers, when you can already cast raw pointers just fine with `as`.
2015-08-03syntax: Implement #![no_core]Alex Crichton-4/+8
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-2/+3
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-05-25Auto merge of #25736 - tshepang:path-nits, r=steveklabnikbors-3/+3
2015-05-23doc: fix Windows test failureTshepang Lekhonkhobe-2/+2
2015-05-23path: make this bit follow idiomTshepang Lekhonkhobe-1/+1
2015-05-23doc: missing wordsTshepang Lekhonkhobe-2/+2
2015-05-21doc: miscellaneous improvements to std::path::Path examplesTshepang Lekhonkhobe-38/+40
2015-05-16libstd: Path docs: `file` is now `file_name`Ryman-2/+2
2015-05-11Rollup merge of #25278 - cpjreynolds:path-doc, r=alexcrichtonSteve Klabnik-1/+1
Change from "must be used with behind a pointer" to "must be used behind a pointer"
2015-05-11docs: Clarify Path::starts_with (and ends_with)Ulrik Sverdrup-0/+6
Fixes #24882
2015-05-10Fix grammar in path::Path documentationCole Reynolds-1/+1
Change from "must be used with behind a pointer" to "must be used behind a pointer"
2015-05-04Fix spelling errors in documentation.Joseph Crail-1/+1
2015-04-25add import (fixup #24649)Manish Goregaokar-0/+2
2015-04-25Rollup merge of #24649 - nham:path_new_examples, r=steveklabnikManish Goregaokar-0/+8
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-33/+1
Conflicts: src/libcore/result.rs
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-1/+1
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-1/+1
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-21std: Remove deprecated AsPath traitAlex Crichton-32/+0
2015-04-21Separate code into two code blocksNick Hamann-3/+4
2015-04-20Address some nitsNick Hamann-2/+2
2015-04-20Add two examples for Path::newNick Hamann-0/+7
2015-04-19Fix typos in code commentsCorey Farwell-2/+2
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-1/+1
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-5/+5
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Test fixes and rebase conflictsAlex Crichton-1/+1
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-16/+16
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-16/+16
2015-04-12Fixed with_extension documentation bugTheo Belaire-1/+2
It was mistakenly calling it with "foo.txt" instead of "txt". I've also added an assert.
2015-04-01rollup merge of #23951: alexcrichton/splitnAlex Crichton-1/+1
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: https://github.com/rust-lang/rfcs/pull/979 Closes #23911 [breaking-change]