about summary refs log tree commit diff
path: root/src/libcore/convert.rs
AgeCommit message (Collapse)AuthorLines
2017-02-02Add a name for the parameter to `TryFrom::try_from`.Jimmy Cuadra-1/+1
Although signatures with anonymous parameters may not be deprecated or removed at this point, the team seems to agree that the ability to have an anonymous parameter is unfortunate historical baggage, and that we shouldn't create new code that uses it. Context: https://github.com/rust-lang/rust/issues/33417#issuecomment-276933861
2017-01-29Add missing url in convert moduleGuillaume Gomez-10/+18
2016-10-21Fix a few links in the docsOliver Middleton-3/+3
2016-09-15Add example in AsMut trait documentationMark-Simulacrum-0/+16
2016-08-31Add missing urls into convert moduleGuillaume Gomez-16/+39
2016-08-24Use `#[prelude_import]` in `libcore`.Jeffrey Seyfried-3/+0
2016-08-12fix small typos in std::convert documentationMatthew Piziak-4/+4
Fix subject-verb agreement in copypasta: "`AsRef` dereference" to "`AsRef` dereferences". Formalize "eg" to "e.g." Italicization of common Latin abbreviations seems to be going out of style in written English, so I left it plain.
2016-05-07Implement RFC 1542Steven Fackler-10/+47
cc #33417
2016-03-29verb agreement in core::convert docsAlex Burka-10/+10
2016-02-09Minor spelling fixesCarlos E. Garcia-1/+1
2016-01-31 Doc:std::convert: disambiguate traits and keywordsThomas Wickham-6/+6
2016-01-15Doc:std::convert: be more specific + typoThomas Wickham-21/+19
2016-01-14Doc:std::convert explicitely list generic implsThomas Wickham-0/+59
Also add a note about the necessary simplicity of the conversion. Related issue: #29349
2015-10-23Make `{Default, From, FromIterator, One, Zero}` well-formedAndrew Paseltiner-1/+1
Using these traits in an object context previously resulted in an RFC 1214 warning.
2015-06-17core: Split apart the global `core` featureAlex Crichton-4/+5
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
2015-05-12TRPL: Borrow and AsRefSteve Klabnik-0/+5
These two traits are commonly confused. As such, explain the difference. Fixes #24163
2015-05-10Add #[inline] to AsRef<str>::as_ref for String and str.Jan Bujak-0/+1
2015-04-26Make From::from example more idiomatic / simplerCorey Farwell-3/+1
2015-04-24Remove reference to 'to'Steve Klabnik-1/+1
FIxes #24712
2015-04-10Add examples for ConvertSteve Klabnik-5/+51
2015-04-04s/Perform/Performs/Andrew Paseltiner-4/+4
Per [RFC #0505](https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#formatting).
2015-03-31Test fixes and rebase conflicts, round 2Alex Crichton-7/+0
2015-03-31rollup merge of #23879: seanmonstar/del-from-errorAlex Crichton-0/+7
Conflicts: src/libcore/error.rs
2015-03-31Stabilize `std::convert` and related codeAaron Turon-16/+22
* Marks `#[stable]` the contents of the `std::convert` module. * Added methods `PathBuf::as_path`, `OsString::as_os_str`, `String::as_str`, `Vec::{as_slice, as_mut_slice}`. * Deprecates `OsStr::from_str` in favor of a new, stable, and more general `OsStr::new`. * Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes, to_cstring}` for ergonomic FFI usage. [breaking-change]
2015-03-30convert: remove FromError, use From<E> insteadSean McArthur-0/+7
This removes the FromError trait, since it can now be expressed using the new convert::Into trait. All implementations of FromError<E> where changed to From<E>, and `try!` was changed to use From::from instead. Because this removes FromError, it is a breaking change, but fixing it simply requires changing the words `FromError` to `From`, and `from_error` to `from`. [breaking-change]
2015-03-26Revise use of conversion traitsAaron Turon-0/+16
This commit revises `path` and `os_str` to use blanket impls for `From` on reference types. This both cuts down on the number of required impls, and means that you can pass through e.g. `T: AsRef<OsStr>` to `PathBuf::from` without an intermediate call to `as_ref`. It also makes a FIXME note for later generalizing the blanket impls for `AsRef` and `AsMut` to use `Deref`/`DerefMut`, once it is possible to do so.
2015-03-23Add generic conversion traitsAaron Turon-0/+113
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]