diff options
| author | Brian Anderson <andersrb@gmail.com> | 2013-02-04 10:15:02 -0800 |
|---|---|---|
| committer | Brian Anderson <andersrb@gmail.com> | 2013-02-04 10:15:02 -0800 |
| commit | 27e1ac5bb93626da70135e167a6596d854e7e679 (patch) | |
| tree | e2a6b58b69d484cae48f9b0a4f2132fbe7f20979 /src/libsyntax | |
| parent | 750f246ad5f3a2a1a4df1a40d547c112074bb447 (diff) | |
| parent | 9adfa59d8e9432eef84297b6ed5d8f2967b9b8f9 (diff) | |
| download | rust-27e1ac5bb93626da70135e167a6596d854e7e679.tar.gz rust-27e1ac5bb93626da70135e167a6596d854e7e679.zip | |
Merge pull request #4684 from erickt/incoming
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" } |
