Skip to content

Commit c668e9e

Browse files
authored
feat: Simplify code by using String::split_ascii_whitespace (#558)
* feat: Simplify code by using `String::split_ascii_whitespace`. * chore: Update the required version for Rust to 1.34.
1 parent e76ec87 commit c668e9e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
steps:
9292
- uses: actions/checkout@master
9393
- name: Install Rust
94-
run: rustup update 1.31.0 --no-self-update && rustup default 1.31.0
94+
run: rustup update 1.34.0 --no-self-update && rustup default 1.34.0
9595
shell: bash
9696
- run: cargo build
9797

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,9 +2154,8 @@ impl Build {
21542154
fn envflags(&self, name: &str) -> Vec<String> {
21552155
self.get_var(name)
21562156
.unwrap_or(String::new())
2157-
.split(|c: char| c.is_whitespace())
2158-
.filter(|s| !s.is_empty())
2159-
.map(|s| s.to_string())
2157+
.split_ascii_whitespace()
2158+
.map(|slice| slice.to_string())
21602159
.collect()
21612160
}
21622161

0 commit comments

Comments
 (0)