Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
12dd4a1
Stabilise c_str_module
clarfonthey Feb 22, 2025
6be84b1
Somehow these stability attributes were able to be omitted before?
clarfonthey Feb 22, 2025
781949d
Use char::is_whitespace directly in str::trim*
DaniPopes Mar 27, 2025
676e29b
fix docs for `Peekable::next_if{_eq}`
yotamofek Mar 28, 2025
3536324
Fix detection of `main` function if there are expressions around it
GuillaumeGomez Apr 23, 2025
81438c0
Add regression ui test for #140162 and for #139651
GuillaumeGomez Apr 23, 2025
3ededc1
Improve code
GuillaumeGomez Apr 25, 2025
3ef98a5
If there is a `;` alone, we consider that the doctest needs to be put…
GuillaumeGomez Apr 25, 2025
43d8d89
clarified bootstrap optimization agrs
Kivooeo Apr 26, 2025
86969db
session: Cleanup `CanonicalizedPath::new`
petrochenkov Apr 26, 2025
9112c86
Update example to use `CStr::to_string_lossy`
shepmaster Apr 25, 2025
8608a3f
lint-docs: Don't hard-code the valid editions
ehuss Apr 26, 2025
1f108fe
Update lint-docs to default to Rust 2024
ehuss Apr 26, 2025
aa69e3a
Fix bad handling of macros if there is already a `main` function
GuillaumeGomez Apr 26, 2025
2257a1c
Rollup merge of #137439 - clarfonthey:c-str-module, r=tgross35
tgross35 Apr 27, 2025
719b5ba
Rollup merge of #139031 - DaniPopes:str-trim-closure, r=tgross35
tgross35 Apr 27, 2025
cc2bc2a
Rollup merge of #139090 - yotamofek:pr/peekable-next-if-docs, r=tgross35
tgross35 Apr 27, 2025
dc57338
Rollup merge of #140220 - GuillaumeGomez:doctest-main-wrapping, r=fmease
tgross35 Apr 27, 2025
e37a3bb
Rollup merge of #140297 - shepmaster:cstr-lossy, r=joboet
tgross35 Apr 27, 2025
c7d9335
Rollup merge of #140330 - Kivooeo:new-fix-five, r=clubby789
tgross35 Apr 27, 2025
b31ae0e
Rollup merge of #140339 - petrochenkov:capanew, r=lqd
tgross35 Apr 27, 2025
c718a63
Rollup merge of #140348 - ehuss:lint-docs-edition, r=compiler-errors
tgross35 Apr 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use char::is_whitespace directly in str::trim*
  • Loading branch information
DaniPopes committed Mar 27, 2025
commit 781949d68b7393d35e02e7acca6a7d523af1cef8
6 changes: 3 additions & 3 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2115,7 +2115,7 @@ impl str {
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_diagnostic_item = "str_trim"]
pub fn trim(&self) -> &str {
self.trim_matches(|c: char| c.is_whitespace())
self.trim_matches(char::is_whitespace)
}

/// Returns a string slice with leading whitespace removed.
Expand Down Expand Up @@ -2154,7 +2154,7 @@ impl str {
#[stable(feature = "trim_direction", since = "1.30.0")]
#[rustc_diagnostic_item = "str_trim_start"]
pub fn trim_start(&self) -> &str {
self.trim_start_matches(|c: char| c.is_whitespace())
self.trim_start_matches(char::is_whitespace)
}

/// Returns a string slice with trailing whitespace removed.
Expand Down Expand Up @@ -2193,7 +2193,7 @@ impl str {
#[stable(feature = "trim_direction", since = "1.30.0")]
#[rustc_diagnostic_item = "str_trim_end"]
pub fn trim_end(&self) -> &str {
self.trim_end_matches(|c: char| c.is_whitespace())
self.trim_end_matches(char::is_whitespace)
}

/// Returns a string slice with leading whitespace removed.
Expand Down
Loading