diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2018-08-22 12:55:47 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2018-08-22 12:56:32 +0200 |
| commit | e6990767802a115d780394f97683528d0bfe960c (patch) | |
| tree | 9f1b6583dfcdd99b36c33ee141c611c3c7386cfa | |
| parent | 786ccc336dc684cdb00402e84abe4a9bc53857cf (diff) | |
use char pattern for single-character splits: a.split("x") -> a.split('x')
| -rw-r--r-- | src/libcore/str/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_incremental/assert_module_sources.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/theme.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 64bdf4d9f48..4dcb65dc3f8 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -59,7 +59,7 @@ pub mod lossy; /// /// fn from_str(s: &str) -> Result<Self, Self::Err> { /// let coords: Vec<&str> = s.trim_matches(|p| p == '(' || p == ')' ) -/// .split(",") +/// .split(',') /// .collect(); /// /// let x_fromstr = coords[0].parse::<i32>()?; diff --git a/src/librustc_incremental/assert_module_sources.rs b/src/librustc_incremental/assert_module_sources.rs index 9b8e2c450d5..139159c1639 100644 --- a/src/librustc_incremental/assert_module_sources.rs +++ b/src/librustc_incremental/assert_module_sources.rs @@ -89,7 +89,7 @@ impl<'a, 'tcx> AssertModuleSource<'a, 'tcx> { (&user_path[..], None) }; - let mut cgu_path_components = user_path.split("-").collect::<Vec<_>>(); + let mut cgu_path_components = user_path.split('-').collect::<Vec<_>>(); // Remove the crate name assert_eq!(cgu_path_components.remove(0), crate_name); diff --git a/src/librustdoc/theme.rs b/src/librustdoc/theme.rs index 96a67e07887..b4d244fa994 100644 --- a/src/librustdoc/theme.rs +++ b/src/librustdoc/theme.rs @@ -205,7 +205,7 @@ fn build_rule(v: &[u8], positions: &[usize]) -> String { .replace("\t", " ") .replace("{", "") .replace("}", "") - .split(" ") + .split(' ') .filter(|s| s.len() > 0) .collect::<Vec<&str>>() .join(" ") |
