Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e3029ab
Improve duplicate derive Copy/Clone diagnostics
VulnBandit Oct 2, 2024
10b60eb
add third help hint to diagnostic error E0027
duncpro Oct 22, 2024
a645342
More test for non-exhaustive C-like enums in FFI
nyurik Oct 29, 2024
d19517d
Support clobber_abi and vector registers (clobber-only) in PowerPC in…
taiki-e Nov 2, 2024
7faa84e
Stabilise 'const_char_encode_utf16';
bjoernager Nov 4, 2024
02a1ab8
Replace checked slice indexing by unchecked to support panic-free code
Nov 1, 2024
37f48da
Updated SAFETY comment to address underflow
Nov 4, 2024
65d8f1b
Fixed typo, rebased
Nov 4, 2024
4872b6b
Improve example of `impl Pattern for &[char]`
eduardosm Nov 4, 2024
107b4fd
docs: fix grammar in doc comment at unix/process.rs
SnirBroshi Nov 4, 2024
f4b72dc
Move two attribute lints to be early pass (post expansion)
jdonszelmann Nov 4, 2024
6eb2299
Rollup merge of #131153 - VulnBandit:copy_impl_vuln, r=compiler-errors
tgross35 Nov 5, 2024
9f52c5f
Rollup merge of #131341 - taiki-e:ppc-clobber-abi, r=bzEq,workingjubilee
tgross35 Nov 5, 2024
df36a43
Rollup merge of #132025 - duncpro:E0027, r=compiler-errors
tgross35 Nov 5, 2024
eb69533
Rollup merge of #132153 - bjoernager:const-char-encode-utf16, r=dtolnay
tgross35 Nov 5, 2024
56344b5
Rollup merge of #132303 - nyurik:non-exhaustive-err, r=compiler-errors
tgross35 Nov 5, 2024
d35f5d5
Rollup merge of #132473 - ZhekaS:core_fmt_radix_no_panic, r=joboet
tgross35 Nov 5, 2024
7094785
Rollup merge of #132598 - jdonszelmann:move-lints-to-early, r=xFrednet
tgross35 Nov 5, 2024
fb4c4c9
Rollup merge of #132606 - eduardosm:char-slice-str-pattern-doc, r=tgr…
tgross35 Nov 5, 2024
c82b671
Rollup merge of #132609 - NotWearingPants:patch-1, r=Amanieu
tgross35 Nov 5, 2024
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
Improve example of impl Pattern for &[char]
The previous version used `['l', 'l']` as pattern, which would suggest that it matches the `ll` of `Hello world` as a whole.
  • Loading branch information
eduardosm committed Nov 4, 2024
commit 4872b6bcbd8f2800b370b7e05b1ca1e18054a166
4 changes: 2 additions & 2 deletions library/core/src/str/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,8 @@ impl<'a, 'b> DoubleEndedSearcher<'a> for CharSliceSearcher<'a, 'b> {}
/// # Examples
///
/// ```
/// assert_eq!("Hello world".find(&['l', 'l'] as &[_]), Some(2));
/// assert_eq!("Hello world".find(&['l', 'l'][..]), Some(2));
/// assert_eq!("Hello world".find(&['o', 'l'][..]), Some(2));
/// assert_eq!("Hello world".find(&['h', 'w'][..]), Some(6));
/// ```
impl<'b> Pattern for &'b [char] {
pattern_methods!('a, CharSliceSearcher<'a, 'b>, MultiCharEqPattern, CharSliceSearcher);
Expand Down
Loading