diff options
| author | Chris Morgan <me@chrismorgan.info> | 2013-12-15 01:04:22 +1100 |
|---|---|---|
| committer | Chris Morgan <me@chrismorgan.info> | 2013-12-15 01:04:22 +1100 |
| commit | b76997f3a947b296ca04be184da88ff1c0959dcb (patch) | |
| tree | caaa309813c8ee9523a9599f44ecbd9029bc21cd /src/libstd | |
| parent | 529f91572870cffdd9f13ddae12bb1f4e03186ab (diff) | |
| download | rust-b76997f3a947b296ca04be184da88ff1c0959dcb.tar.gz rust-b76997f3a947b296ca04be184da88ff1c0959dcb.zip | |
Rename To{Str,Bytes}Consume traits to Into*.
That is: - `ToStrConsume` → `IntoStr`; - `ToBytesConsume` → `IntoBytes`.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ascii.rs | 8 | ||||
| -rw-r--r-- | src/libstd/prelude.rs | 4 | ||||
| -rw-r--r-- | src/libstd/to_str.rs | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index 2242ded94f5..4cdcbbdb9e8 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -10,7 +10,7 @@ //! Operations on ASCII strings and characters. -use to_str::{ToStr,ToStrConsume}; +use to_str::{ToStr,IntoStr}; use str; use str::StrSlice; use str::OwnedStr; @@ -294,7 +294,7 @@ impl<'a> AsciiStr for &'a [Ascii] { } } -impl ToStrConsume for ~[Ascii] { +impl IntoStr for ~[Ascii] { #[inline] fn into_str(self) -> ~str { unsafe { cast::transmute(self) } @@ -309,12 +309,12 @@ impl IterBytes for Ascii { } /// Trait to convert to a owned byte array by consuming self -pub trait ToBytesConsume { +pub trait IntoBytes { /// Converts to a owned byte array by consuming self fn into_bytes(self) -> ~[u8]; } -impl ToBytesConsume for ~[Ascii] { +impl IntoBytes for ~[Ascii] { fn into_bytes(self) -> ~[u8] { unsafe { cast::transmute(self) } } diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index 83439d4c903..6407b34c576 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -45,7 +45,7 @@ pub use io::stdio::{print, println}; // Reexported types and traits pub use any::{Any, AnyOwnExt, AnyRefExt, AnyMutRefExt}; -pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, ToBytesConsume}; +pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes}; pub use bool::Bool; pub use c_str::ToCStr; pub use char::Char; @@ -71,7 +71,7 @@ pub use io::{Buffer, Writer, Reader, Seek}; pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr}; pub use str::{Str, StrVector, StrSlice, OwnedStr}; pub use to_bytes::IterBytes; -pub use to_str::{ToStr, ToStrConsume}; +pub use to_str::{ToStr, IntoStr}; pub use tuple::{CopyableTuple, ImmutableTuple}; pub use tuple::{ImmutableTuple1, ImmutableTuple2, ImmutableTuple3, ImmutableTuple4}; pub use tuple::{ImmutableTuple5, ImmutableTuple6, ImmutableTuple7, ImmutableTuple8}; diff --git a/src/libstd/to_str.rs b/src/libstd/to_str.rs index 41c8aef18f4..a58b09d8ecd 100644 --- a/src/libstd/to_str.rs +++ b/src/libstd/to_str.rs @@ -30,7 +30,7 @@ pub trait ToStr { } /// Trait for converting a type to a string, consuming it in the process. -pub trait ToStrConsume { +pub trait IntoStr { /// Consume and convert to a string. fn into_str(self) -> ~str; } |
