Skip to content

Commit cb24b71

Browse files
Refactor upcase
1 parent a35a799 commit cb24b71

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/casefiddle.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ fn capitalize(s: &str) -> String {
88

99
#[defun]
1010
fn upcase(s: &str) -> String {
11-
s.chars()
12-
.flat_map(|c| c.to_uppercase())
13-
.collect::<String>()
11+
s.to_uppercase()
1412
// re-escape string
1513
.replace('\\', "\\\\")
1614
.replace('"', "\\\"")

0 commit comments

Comments
 (0)