Skip to content

Commit b76997f

Browse files
committed
Rename To{Str,Bytes}Consume traits to Into*.
That is: - `ToStrConsume` → `IntoStr`; - `ToBytesConsume` → `IntoBytes`.
1 parent 529f915 commit b76997f

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/etc/vim/syntax/rust.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ syn keyword rustEnumVariant Ok Err
6666

6767
" Types and traits {{{3
6868
syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
69-
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume
69+
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes
7070
syn keyword rustTrait Bool
7171
syn keyword rustTrait ToCStr
7272
syn keyword rustTrait Char
@@ -94,7 +94,7 @@ syn keyword rustTrait Buffer Writer Reader Seek
9494
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
9595
syn keyword rustTrait Str StrVector StrSlice OwnedStr
9696
syn keyword rustTrait IterBytes
97-
syn keyword rustTrait ToStr ToStrConsume
97+
syn keyword rustTrait ToStr IntoStr
9898
syn keyword rustTrait CopyableTuple ImmutableTuple
9999
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
100100
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8

src/libstd/ascii.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! Operations on ASCII strings and characters.
1212
13-
use to_str::{ToStr,ToStrConsume};
13+
use to_str::{ToStr,IntoStr};
1414
use str;
1515
use str::StrSlice;
1616
use str::OwnedStr;
@@ -294,7 +294,7 @@ impl<'a> AsciiStr for &'a [Ascii] {
294294
}
295295
}
296296

297-
impl ToStrConsume for ~[Ascii] {
297+
impl IntoStr for ~[Ascii] {
298298
#[inline]
299299
fn into_str(self) -> ~str {
300300
unsafe { cast::transmute(self) }
@@ -309,12 +309,12 @@ impl IterBytes for Ascii {
309309
}
310310

311311
/// Trait to convert to a owned byte array by consuming self
312-
pub trait ToBytesConsume {
312+
pub trait IntoBytes {
313313
/// Converts to a owned byte array by consuming self
314314
fn into_bytes(self) -> ~[u8];
315315
}
316316

317-
impl ToBytesConsume for ~[Ascii] {
317+
impl IntoBytes for ~[Ascii] {
318318
fn into_bytes(self) -> ~[u8] {
319319
unsafe { cast::transmute(self) }
320320
}

src/libstd/prelude.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub use io::stdio::{print, println};
4545
// Reexported types and traits
4646

4747
pub use any::{Any, AnyOwnExt, AnyRefExt, AnyMutRefExt};
48-
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, ToBytesConsume};
48+
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes};
4949
pub use bool::Bool;
5050
pub use c_str::ToCStr;
5151
pub use char::Char;
@@ -71,7 +71,7 @@ pub use io::{Buffer, Writer, Reader, Seek};
7171
pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr};
7272
pub use str::{Str, StrVector, StrSlice, OwnedStr};
7373
pub use to_bytes::IterBytes;
74-
pub use to_str::{ToStr, ToStrConsume};
74+
pub use to_str::{ToStr, IntoStr};
7575
pub use tuple::{CopyableTuple, ImmutableTuple};
7676
pub use tuple::{ImmutableTuple1, ImmutableTuple2, ImmutableTuple3, ImmutableTuple4};
7777
pub use tuple::{ImmutableTuple5, ImmutableTuple6, ImmutableTuple7, ImmutableTuple8};

src/libstd/to_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub trait ToStr {
3030
}
3131

3232
/// Trait for converting a type to a string, consuming it in the process.
33-
pub trait ToStrConsume {
33+
pub trait IntoStr {
3434
/// Consume and convert to a string.
3535
fn into_str(self) -> ~str;
3636
}

0 commit comments

Comments
 (0)