We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Pattern::{is_prefix_of,is_suffix_of}
char
1 parent 1f6d023 commit de7fefaCopy full SHA for de7fefa
src/libcore/str/pattern.rs
@@ -450,15 +450,13 @@ impl<'a> Pattern<'a> for char {
450
451
#[inline]
452
fn is_prefix_of(self, haystack: &'a str) -> bool {
453
- let mut buffer = [0u8; 4];
454
- self.encode_utf8(&mut buffer).is_prefix_of(haystack)
+ self.encode_utf8(&mut [0u8; 4]).is_prefix_of(haystack)
455
}
456
457
458
fn is_suffix_of(self, haystack: &'a str) -> bool where Self::Searcher: ReverseSearcher<'a>
459
{
460
461
- self.encode_utf8(&mut buffer).is_suffix_of(haystack)
+ self.encode_utf8(&mut [0u8; 4]).is_suffix_of(haystack)
462
463
464
0 commit comments