about summary refs log tree commit diff
path: root/src/libstd/path.rs
AgeCommit message (Collapse)AuthorLines
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-2/+2
2015-02-18make FromIterator use IntoIteratorAlexis-1/+1
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18make Extend use IntoIteratorAlexis-2/+2
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of Extend should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-17rollup merge of #22208: aturon/expose-more-pathAlex Crichton-123/+126
This commit exposes the `is_sep` function and `MAIN_SEP` constant, as well as Windows path prefixes. The path prefix enum is safely exposed on all platforms, but it only yielded as a component for Windows. Exposing the prefix enum as part of prefix components involved changing the type from `OsStr` to the `Prefix` enum, which is a: [breaking-change]
2015-02-16Expose more of std::pathAaron Turon-123/+126
This commit exposes the `is_sep` function and `MAIN_SEP` constant, as well as Windows path prefixes. The path prefix enum is safely exposed on all platforms, but it only yielded as a component for Windows. Exposing the prefix enum as part of prefix components involved changing the type from `OsStr` to the `Prefix` enum, which is a: [breaking-change]
2015-02-14we forgot to make `Path` implement `Hash`Jorge Israel Peña-0/+1
`PathBuf` does implement `Hash`, but `Path` doesn't. This makes it annoying if you have a `HashMap` with `PathBuf`s as keys, because it means you have to convert a `Path` into a `PathBuf` and get a reference to it simply to perform operations on the `HashMap`!
2015-02-13Add std::processAaron Turon-0/+5
Per [RFC 579](https://github.com/rust-lang/rfcs/pull/579), this commit adds a new `std::process` module. This module is largely based on the existing `std::old_io::process` module, but refactors the API to use `OsStr` and other new standards set out by IO reform. The existing module is not yet deprecated, to allow for the new API to get a bit of testing before a mass migration to it.
2015-02-11Documentation fix for PathBuf#popBen S-1/+2
It returns `false`, not `none`.
2015-02-10Auto merge of #21936 - alexcrichton:fsv2, r=aturonbors-0/+6
This commit is an implementation of [RFC 739][rfc] which adds a new `std::fs` module to the standard library. This module provides much of the same functionality as `std::old_io::fs` but it has many tweaked APIs as well as uses the new `std::path` module. [rfc]: https://github.com/rust-lang/rfcs/pull/739
2015-02-09std: Add a new `fs` moduleAlex Crichton-0/+6
This commit is an implementation of [RFC 739][rfc] which adds a new `std::fs` module to the standard library. This module provides much of the same functionality as `std::old_io::fs` but it has many tweaked APIs as well as uses the new `std::path` module. [rfc]: https://github.com/rust-lang/rfcs/pull/739
2015-02-04Fix for misspelled comments.Joseph Crail-2/+2
The spelling corrections were made in both documentation comments and regular comments.
2015-02-03Test fixes and rebase conflictsAlex Crichton-14/+24
2015-02-03Add new path moduleAaron Turon-0/+2567
Implements [RFC 474](https://github.com/rust-lang/rfcs/pull/474); see that RFC for details/motivation for this change. This initial commit does not include additional normalization or platform-specific path extensions. These will be done in follow up commits or PRs.
2013-10-15path2: Replace the path module outrightKevin Ballard-1507/+0
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-3/+3
Closes #9467
2013-09-30std: Remove usage of fmt!Alex Crichton-11/+11
2013-09-25rustpkg: Search for packages correctly when using the rust_path_hackTim Chevalier-22/+31
Previously, any package would match any other package ID when searching using the rust_path_hack, so long as the directory had one or more crate files in it. Now, rustpkg checks that the parent directory matches the package ID. Closes #9273
2013-09-25std: Add an is_parent_of method to PathTim Chevalier-0/+45
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-1/+1
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-09-05Minor doc cleanup.Lindsey Kuper-11/+12
2013-09-05Factor shared code out into default GenericPath methods.Lindsey Kuper-223/+144
2013-09-04Revise path.rs API to not allocate ~str so much.Felix S. Klock II-25/+25
Note that I left dirname as returning ~str, because both of its implementations work by calling dir_path, which produces a new path, and thus we cannot borrow the result from &'a self passed to dirname (because the new path returned by dir_path will not live long enough to satisfy the lifetime 'a).
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+5
2013-08-15Add ToCStr method .with_c_str()Kevin Ballard-3/+3
.with_c_str() is a replacement for the old .as_c_str(), to avoid unnecessary boilerplate. Replace all usages of .to_c_str().with_ref() with .with_c_str().
2013-08-15Check for interior nulls in .to_c_str()Kevin Ballard-0/+8
Previous dicussions about CString suggested that interior nulls should throw an error. This was never implemented. Add this now, using a condition (named null_byte) to allow for recovery. Add method .to_c_str_unchecked() that skips this check.
2013-08-10std: merge Iterator and IteratorUtilErick Tryzelaar-1/+1
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-2/+2
cc #7887
2013-08-09Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-2/+163
remove-str-trailing-nulls
2013-08-09std/rustc/rustpkg/syntax: Support the `extern mod = ...` formTim Chevalier-2/+163
This commit allows you to write: extern mod x = "a/b/c"; which means rustc will search in the RUST_PATH for a package with ID a/b/c, and bind it to the name `x` if it's found. Incidentally, move get_relative_to from back::rpath into std::path
2013-08-04Merge remote-tracking branch 'remotes/origin/master' into str-remove-nullErick Tryzelaar-7/+7
2013-08-04std: replace str::as_c_str with std::c_strErick Tryzelaar-4/+17
2013-08-03remove obsolete `foreach` keywordDaniel Micay-7/+7
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-8/+8
2013-07-30No longer treat \ as a path separator on posix systems.Gareth Smith-4/+22
2013-07-23std: move StrUtil::as_c_str into StrSliceErick Tryzelaar-22/+15
2013-07-18rustpkg: Make rustpkg commands work without a package IDTim Chevalier-1/+41
`rustpkg build`, if executed in a package source directory inside a workspace, will now build that package. By "inside a workspace" I mean that the parent directory has to be called `src`, and rustpkg will create a `build` directory in .. if there isn't already one. Same goes for `rustpkg install` and `rustpkg clean`. For the time being, `rustpkg build` (etc.) will still error out if you run it inside a directory whose parent isn't called `src`. I'm not sure whether or not it's desirable to have it do something in a non-workspace directory.
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-37/+41
2013-06-28Add each_parent to WindowsPathCorey Richardson-0/+8
2013-06-28librustc: Fix merge fallout.Patrick Walton-1/+1
2013-06-28librustc: Rewrite reachability and forbid duplicate methods in type ↵Patrick Walton-9/+47
implementations. This should allow fewer symbols to be exported.
2013-06-28librustc: Remove the broken overloaded assign-ops from the language.Patrick Walton-5/+11
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.
2013-06-27rustpkg: Implement RUST_PATHTim Chevalier-0/+9
Unfortunately, the main test for this is ignored due to #7071. Closes #5682
2013-06-23vec: remove BaseIter implementationDaniel Micay-5/+4
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-20auto merge of #7128 : yichoi/rust/fix_sometc, r=brsonbors-1/+29
- Fix stat struct for Android (found by SEGV at run-pass/stat.rs) - Adjust some test cases to rpass for Android - Modify some script to rpass for Android
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-1/+1
2013-06-17std: fix stat struct of android (SEGV error from run-pass/stat.rs on android)Young-il Choi-1/+29
2013-06-16remove unused importsHuon Wilson-1/+0
2013-06-16std: test-fixes, remove warnings, syntax highlighting for code examples.Huon Wilson-6/+6
2013-06-14std: get std::path tests to work againErick Tryzelaar-0/+1
2013-06-13Revert "std: convert {vec,str}::to_owned to methods."Brian Anderson-6/+6
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