about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-30 06:29:39 +0000
committerbors <bors@rust-lang.org>2018-07-30 06:29:39 +0000
commit7bbcd005b30582d07f1a39dcf50f77b54e055828 (patch)
treeee814e901b90440bc7b76ab13bdbb7468b3b17de /src/libstd/sys
parenta3f519df09bf40d09c1a111599b8f115f11fbb49 (diff)
parent421b2ba347a3a1afa41b91f4254f238c790fd73b (diff)
downloadrust-7bbcd005b30582d07f1a39dcf50f77b54e055828.tar.gz
rust-7bbcd005b30582d07f1a39dcf50f77b54e055828.zip
Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkov
Don't format!() string literals

Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/wasm/os.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sys/wasm/os.rs b/src/libstd/sys/wasm/os.rs
index 23ca1754719..0cb991e19b0 100644
--- a/src/libstd/sys/wasm/os.rs
+++ b/src/libstd/sys/wasm/os.rs
@@ -21,7 +21,7 @@ pub fn errno() -> i32 {
 }
 
 pub fn error_string(_errno: i32) -> String {
-    format!("operation successful")
+    "operation successful".to_string()
 }
 
 pub fn getcwd() -> io::Result<PathBuf> {