Skip to content

Commit 23ea1b8

Browse files
committed
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')
2 parents 5a0a9a2 + e699076 commit 23ea1b8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/libcore/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub mod lossy;
5959
///
6060
/// fn from_str(s: &str) -> Result<Self, Self::Err> {
6161
/// let coords: Vec<&str> = s.trim_matches(|p| p == '(' || p == ')' )
62-
/// .split(",")
62+
/// .split(',')
6363
/// .collect();
6464
///
6565
/// let x_fromstr = coords[0].parse::<i32>()?;

src/librustc_incremental/assert_module_sources.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<'a, 'tcx> AssertModuleSource<'a, 'tcx> {
8989
(&user_path[..], None)
9090
};
9191

92-
let mut cgu_path_components = user_path.split("-").collect::<Vec<_>>();
92+
let mut cgu_path_components = user_path.split('-').collect::<Vec<_>>();
9393

9494
// Remove the crate name
9595
assert_eq!(cgu_path_components.remove(0), crate_name);

src/librustdoc/theme.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fn build_rule(v: &[u8], positions: &[usize]) -> String {
205205
.replace("\t", " ")
206206
.replace("{", "")
207207
.replace("}", "")
208-
.split(" ")
208+
.split(' ')
209209
.filter(|s| s.len() > 0)
210210
.collect::<Vec<&str>>()
211211
.join(" ")

0 commit comments

Comments
 (0)