diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-02-03 20:47:26 -0800 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-02-03 20:47:26 -0800 |
| commit | 9adfa59d8e9432eef84297b6ed5d8f2967b9b8f9 (patch) | |
| tree | 7a0c4a0e10601298c67939598fa173a0e72e9408 /src/libsyntax | |
| parent | 9556629da2284757efcb543fa5e27c0c94fc5e10 (diff) | |
| download | rust-9adfa59d8e9432eef84297b6ed5d8f2967b9b8f9.tar.gz rust-9adfa59d8e9432eef84297b6ed5d8f2967b9b8f9.zip | |
core: convert ToStr::to_str to take explicit &self
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 20 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/proto.rs | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index a651090cf64..bc808495ca3 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -923,8 +923,8 @@ pub enum trait_method { pub enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, } pub impl int_ty : ToStr { - pure fn to_str() -> ~str { - ::ast_util::int_ty_to_str(self) + pure fn to_str(&self) -> ~str { + ::ast_util::int_ty_to_str(*self) } } @@ -959,8 +959,8 @@ pub impl int_ty : cmp::Eq { pub enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, } pub impl uint_ty : ToStr { - pure fn to_str() -> ~str { - ::ast_util::uint_ty_to_str(self) + pure fn to_str(&self) -> ~str { + ::ast_util::uint_ty_to_str(*self) } } @@ -993,8 +993,8 @@ pub impl uint_ty : cmp::Eq { pub enum float_ty { ty_f, ty_f32, ty_f64, } pub impl float_ty : ToStr { - pure fn to_str() -> ~str { - ::ast_util::float_ty_to_str(self) + pure fn to_str(&self) -> ~str { + ::ast_util::float_ty_to_str(*self) } } @@ -1096,8 +1096,8 @@ pub enum Onceness { } pub impl Onceness : ToStr { - pure fn to_str() -> ~str { - match self { + pure fn to_str(&self) -> ~str { + match *self { Once => ~"once", Many => ~"many" } @@ -1188,8 +1188,8 @@ pub enum purity { } pub impl purity : ToStr { - pure fn to_str() -> ~str { - match self { + pure fn to_str(&self) -> ~str { + match *self { impure_fn => ~"impure", unsafe_fn => ~"unsafe", pure_fn => ~"pure", diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 5c2dd82eb7f..6a1d9357694 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -34,8 +34,8 @@ pub impl direction : cmp::Eq { } pub impl direction: ToStr { - pure fn to_str() -> ~str { - match self { + pure fn to_str(&self) -> ~str { + match *self { send => ~"Send", recv => ~"Recv" } |
