std: Rename the ToStr trait to ToString, and to_str to to_string.
[breaking-change]
This commit is contained in:
committed by
Brian Anderson
parent
bfe4ddfdea
commit
12c334a77b
@@ -48,7 +48,7 @@ pub fn stmt_id(s: &Stmt) -> NodeId {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn binop_to_str(op: BinOp) -> &'static str {
|
||||
pub fn binop_to_string(op: BinOp) -> &'static str {
|
||||
match op {
|
||||
BiAdd => "+",
|
||||
BiSub => "-",
|
||||
@@ -87,7 +87,7 @@ pub fn is_shift_binop(b: BinOp) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn unop_to_str(op: UnOp) -> &'static str {
|
||||
pub fn unop_to_string(op: UnOp) -> &'static str {
|
||||
match op {
|
||||
UnBox => "box(GC) ",
|
||||
UnUniq => "box() ",
|
||||
@@ -103,7 +103,7 @@ pub fn is_path(e: Gc<Expr>) -> bool {
|
||||
|
||||
// Get a string representation of a signed int type, with its value.
|
||||
// We want to avoid "45int" and "-3int" in favor of "45" and "-3"
|
||||
pub fn int_ty_to_str(t: IntTy, val: Option<i64>) -> String {
|
||||
pub fn int_ty_to_string(t: IntTy, val: Option<i64>) -> String {
|
||||
let s = match t {
|
||||
TyI if val.is_some() => "i",
|
||||
TyI => "int",
|
||||
@@ -133,7 +133,7 @@ pub fn int_ty_max(t: IntTy) -> u64 {
|
||||
|
||||
// Get a string representation of an unsigned int type, with its value.
|
||||
// We want to avoid "42uint" in favor of "42u"
|
||||
pub fn uint_ty_to_str(t: UintTy, val: Option<u64>) -> String {
|
||||
pub fn uint_ty_to_string(t: UintTy, val: Option<u64>) -> String {
|
||||
let s = match t {
|
||||
TyU if val.is_some() => "u",
|
||||
TyU => "uint",
|
||||
@@ -158,7 +158,7 @@ pub fn uint_ty_max(t: UintTy) -> u64 {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn float_ty_to_str(t: FloatTy) -> String {
|
||||
pub fn float_ty_to_string(t: FloatTy) -> String {
|
||||
match t {
|
||||
TyF32 => "f32".to_string(),
|
||||
TyF64 => "f64".to_string(),
|
||||
@@ -229,11 +229,11 @@ pub fn unguarded_pat(a: &Arm) -> Option<Vec<Gc<Pat>>> {
|
||||
/// listed as `__extensions__::method_name::hash`, with no indication
|
||||
/// of the type).
|
||||
pub fn impl_pretty_name(trait_ref: &Option<TraitRef>, ty: &Ty) -> Ident {
|
||||
let mut pretty = pprust::ty_to_str(ty);
|
||||
let mut pretty = pprust::ty_to_string(ty);
|
||||
match *trait_ref {
|
||||
Some(ref trait_ref) => {
|
||||
pretty.push_char('.');
|
||||
pretty.push_str(pprust::path_to_str(&trait_ref.path).as_slice());
|
||||
pretty.push_str(pprust::path_to_string(&trait_ref.path).as_slice());
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user