about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-03-05 22:04:10 +0100
committerGitHub <noreply@github.com>2020-03-05 22:04:10 +0100
commit67d735c4bf99dbbbe2eea9a90a0149ffa942f492 (patch)
tree9c326d06402d57d5165e349e36ee6d018df3085f /src/libstd
parent558115b86ccc60aa2132f0e66527bc24842d1ade (diff)
parent84577c86bf5e1908acfc2cd097684f11e828518c (diff)
downloadrust-67d735c4bf99dbbbe2eea9a90a0149ffa942f492.tar.gz
rust-67d735c4bf99dbbbe2eea9a90a0149ffa942f492.zip
Rollup merge of #69736 - matthiaskrgr:even_more_clippy, r=Dylan-DPC
even more clippy cleanups

* Don't pass &mut where immutable reference (&) is sufficient (clippy::unnecessary_mut_passed)
* Use more efficient &&str to String conversion (clippy::inefficient_to_string)
* Don't always eval arguments inside .expect(), use unwrap_or_else and closure. (clippy::expect_fun_call)
* Use righthand '&' instead of lefthand "ref". (clippy::toplevel_ref_arg)
* Use simple 'for i in x' loops instead of 'while let Some(i) = x.next()' loops on iterators. (clippy::while_let_on_iterator)
* Const items have by default a static lifetime, there's no need to annotate it. (clippy::redundant_static_lifetimes)
* Remove redundant patterns when matching ( x @ _  to  x) (clippy::redundant_pattern)
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sys/unix/process/process_common.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs
index 83f052c898b..859da691ad2 100644
--- a/src/libstd/sys/unix/process/process_common.rs
+++ b/src/libstd/sys/unix/process/process_common.rs
@@ -19,9 +19,9 @@ cfg_if::cfg_if! {
     if #[cfg(target_os = "fuchsia")] {
         // fuchsia doesn't have /dev/null
     } else if #[cfg(target_os = "redox")] {
-        const DEV_NULL: &'static str = "null:\0";
+        const DEV_NULL: &str = "null:\0";
     } else {
-        const DEV_NULL: &'static str = "/dev/null\0";
+        const DEV_NULL: &str = "/dev/null\0";
     }
 }