about summary refs log tree commit diff
path: root/src/libstd/ffi/os_str.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-1365/+0
2020-05-19Auto merge of #71447 - cuviper:unsized_cow, r=dtolnaybors-0/+11
impl From<Cow> for Box, Rc, and Arc These forward `Borrowed`/`Owned` values to existing `From` impls. - `Box<T>` is a fundamental type, so it would be a breaking change to add a blanket impl. Therefore, `From<Cow>` is only implemented for `[T]`, `str`, `CStr`, `OsStr`, and `Path`. - For `Rc<T>` and `Arc<T>`, `From<Cow>` is implemented for everything that implements `From` the borrowed and owned types separately.
2020-04-29Implement FromStr for OsStringMike Hommey-0/+10
2020-04-22impl From<Cow> for boxed slices and stringsJosh Stone-0/+11
These forward `Borrowed`/`Owned` values to existing `Box::from` impls. - `From<Cow<'_, [T]>> for Box<[T]>` - `From<Cow<'_, str>> for Box<str>` - `From<Cow<'_, CStr>> for Box<CStr>` - `From<Cow<'_, OsStr>> for Box<OsStr>` - `From<Cow<'_, Path>> for Box<Path>`
2020-04-06Forward OsStr::clone_into to the inner VecJosh Stone-2/+1
Despite OS differences, they're all just `Vec<u8>` inside, so we can just forward `clone_into` calls to that optimized implementation.
2020-03-28add tracking issueTyPR124-6/+6
2020-03-28move doc links for consistencyTyPR124-4/+4
2020-03-28remove unnecessary commentsTyPR124-2/+0
2020-03-28ascii methods on osstrTyPR124-0/+143
2020-03-20add comment about maintaining OsStr encodingTyPR124-0/+2
2020-03-16add comments about safetyTyPR124-0/+4
2020-03-16allowing getting &mut OsStr from OsStringTyPR124-0/+21
2020-01-10inline `impl AsRef<OsStr> for OsString`Lzu Tao-0/+1
2020-01-10Inline to make OsStr::is_empty zero costLzu Tao-0/+1
2019-12-22Format the worldMark Rousskov-23/+45
2019-12-09inline some common methods on OsStrLzu Tao-0/+8
2019-08-22Fix for 7e13679.Tomasz Różański-2/+2
2019-08-22Fix punctuation.Tomasz Różański-1/+1
2019-08-22Remove redundant `mut`.Tomasz Różański-1/+1
2019-08-11Rollup merge of #61969 - MikailBag:master, r=CentrilMark Rousskov-0/+6
Add #[repr(transparent)] for several types In some functions, types mentioned in this PR are transmuted into their inner value. Example for `PathBuf`: https://github.com/rust-lang/rust/blob/master/src/libstd/path.rs#L1132. This PR adds `#[repr(transparent)]` to those types, so their correct behavior doesn't depend on compiler details. (As far as I understand, currently that line, converting `PathBuf` to `Vec<u8>`, is UB).
2019-08-09Add FIXME-s that some types should be transparentMikail Bagishov-0/+6
2019-07-07Add missing urls for osstrGuillaume Gomez-3/+4
2019-05-04Fix intra-doc link resolution failure on re-exporting libstdTaiki Endo-0/+2
2019-04-04Mark unix::ffi::OsStrExt methods as inlineKonrad Borowski-0/+1
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-4/+4
2019-03-09Use lifetime contravariance to elide more lifetimes in core+alloc+stdScott McMurray-8/+8
2019-02-28libstd => 2018Taiki Endo-12/+12
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-2/+2
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-17Use more impl header lifetime elisionScott McMurray-2/+2
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-10libs: doc commentsAlexander Regueiro-1/+1
2019-02-10tests: doc commentsAlexander Regueiro-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-12use actual invalid string in OsStr::to_string_lossy exampleLyndon Brown-8/+33
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-03Rollup merge of #56432 - ordovicia:shrink-to-issue, r=Centrilkennytm-1/+1
Update issue number of `shrink_to` methods to point the tracking issue Tracking issue: #56431
2018-12-02Update issue number of `shrink_to` methods to point the tracking issueHidehito Yabuuchi-1/+1
2018-11-21OsStr: clarify `len()` method documentationLyndon Brown-6/+11
2018-11-21OsString: mention storage form in discussionLyndon Brown-0/+7
Helps users to understand capacity related values, which may surpise on Windows. Also is a step towards clarifying understanding of `OsStr`'s len() return value.
2018-09-17OsStr: Document that it's not NUL terminatedColin Walters-1/+4
I somehow got confused into thinking this was the case, but it's definitely not. Let's help the common case of people who have an `OsStr` and need to call e.g. Unix APIs.
2018-09-13Fix the stable release of os_str_str_ref_eqJosh Stone-2/+2
This was added and stabilized in commit 02503029b83a, but while that claimed to be for 1.28.0, it didn't actually make it until 1.29.0.
2018-09-06Fix linkGuillaume Gomez-3/+0
2018-08-11Add links to std::char::REPLACEMENT_CHARACTER from docs.Corey Farwell-1/+3
There are a few places where we mention the replacement character in the docs, and it could be helpful for users to utilize the constant which is available in the standard library, so let’s link to it!
2018-07-23Seperate summaries from rest of the commentMarkus Wein-0/+1
2018-07-16Document From conversions for OsString and OsStrMarkus Wein-0/+21
2018-07-12Rollup merge of #51912 - mbrubeck:more_box_slice_clone, r=alexcrichtonkennytm-0/+8
impl Clone for Box<CStr>, Box<OsStr>, Box<Path> Implements #51908.
2018-07-06impl Clone for Box<CStr>, Box<OsStr>, Box<Path>Matt Brubeck-0/+8
Implements #51908.
2018-06-29Fix stability attributesGabriel Majeri-2/+2
2018-06-29Implement PartialEq between &str and OsStringGabriel Majeri-0/+14
Allows for example `os_string == "something"`
2018-05-09Update features to 1.28.0George Burton-4/+4
2018-04-27Update the stable attributes to use the current nightly version numberGeorge Burton-4/+4