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:
commit
23ea1b8188
@ -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>()?;
|
||||
|
@ -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);
|
||||
|
@ -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(" ")
|
||||
|
Loading…
x
Reference in New Issue
Block a user