]> git.lizzy.rs Git - rust.git/commitdiff
Rename To{Str,Bytes}Consume traits to Into*.
authorChris Morgan <me@chrismorgan.info>
Sat, 14 Dec 2013 14:04:22 +0000 (01:04 +1100)
committerChris Morgan <me@chrismorgan.info>
Sat, 14 Dec 2013 14:04:22 +0000 (01:04 +1100)
That is:

- `ToStrConsume` → `IntoStr`;
- `ToBytesConsume` → `IntoBytes`.

src/etc/vim/syntax/rust.vim
src/libstd/ascii.rs
src/libstd/prelude.rs
src/libstd/to_str.rs

index 9131c4faa8021621afcafcf26c4da5514d42f9e4..aa0549a861c89010fc54270bc11b9de3f8ba52cb 100644 (file)
@@ -66,7 +66,7 @@ syn keyword   rustEnumVariant Ok Err
 
 " Types and traits {{{3
 syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
-syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume
+syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes
 syn keyword rustTrait Bool
 syn keyword rustTrait ToCStr
 syn keyword rustTrait Char
@@ -94,7 +94,7 @@ syn keyword rustTrait Buffer Writer Reader Seek
 syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
 syn keyword rustTrait Str StrVector StrSlice OwnedStr
 syn keyword rustTrait IterBytes
-syn keyword rustTrait ToStr ToStrConsume
+syn keyword rustTrait ToStr IntoStr
 syn keyword rustTrait CopyableTuple ImmutableTuple
 syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
 syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
index 2242ded94f53faaa2a03a5067cf7459955452042..4cdcbbdb9e8e168f243e1b76cf2aaff183806d12 100644 (file)
@@ -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 @@ fn eq_ignore_case(self, other: &[Ascii]) -> bool {
     }
 }
 
-impl ToStrConsume for ~[Ascii] {
+impl IntoStr for ~[Ascii] {
     #[inline]
     fn into_str(self) -> ~str {
         unsafe { cast::transmute(self) }
@@ -309,12 +309,12 @@ fn iter_bytes(&self, _lsb0: bool, f: |buf: &[u8]| -> bool) -> bool {
 }
 
 /// 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) }
     }
index 83439d4c9030566b7c730bdc1884439cc74a2a5a..6407b34c576f0fd6cbef692a097cc175f278dd33 100644 (file)
@@ -45,7 +45,7 @@
 // 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 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};
index 41c8aef18f47c2b79244a312224174e580ca2988..a58b09d8ecde37bb6ecaa06ded4fede55a6b630d 100644 (file)
@@ -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;
 }