Skip to content

Commit ede1f7d

Browse files
committedAug 23, 2018
use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()
1 parent e73077e commit ede1f7d

File tree

87 files changed

+133
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+133
-133
lines changed
 

‎src/librustc/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
13301330
s
13311331
};
13321332
let var_description = match var_origin {
1333-
infer::MiscVariable(_) => "".to_string(),
1333+
infer::MiscVariable(_) => String::new(),
13341334
infer::PatternRegion(_) => " for pattern".to_string(),
13351335
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
13361336
infer::Autoref(_) => " for autoref".to_string(),

‎src/librustc/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
21052105
region
21062106
} else {
21072107
// Do not even print 'static
2108-
"".to_owned()
2108+
String::new()
21092109
};
21102110
write!(fmt, "&{}{}{:?}", region, kind_str, place)
21112111
}

0 commit comments

Comments
 (0)
Please sign in to comment.