Auto merge of #53599 - matthiaskrgr:split_str__to__split_char, r=frewsxcv

use char pattern for single-character splits: a.split("x") -> a.split('x')
This commit is contained in:
bors 2018-09-02 15:27:56 +00:00
commit 23ea1b8188
3 changed files with 3 additions and 3 deletions

View File

@ -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>()?;

View File

@ -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);

View File

@ -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(" ")