@@ -42,6 +42,9 @@ const WHITESPACE: &[char] = &[
42
42
/// allocator. Very short strings (7 bytes or fewer) are stored directly inside the
43
43
/// `FuriString` struct (which is stored on the heap), while longer strings are allocated
44
44
/// on the heap by the Flipper Zero firmware.
45
+ ///
46
+ /// [`CString`]: alloc::ffi::CString
47
+ /// [`String`]: alloc::string::String
45
48
#[ derive( Eq ) ]
46
49
pub struct FuriString ( NonNull < sys:: FuriString > ) ;
47
50
@@ -296,11 +299,10 @@ impl FuriString {
296
299
///
297
300
/// Returns `false` if it does not.
298
301
///
299
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
302
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
300
303
/// [`char`]s.
301
304
///
302
305
/// [`char`]: prim@char
303
- /// [pattern]: self::pattern
304
306
#[ inline]
305
307
pub fn contains < P : Pattern > ( & self , pat : P ) -> bool {
306
308
pat. is_contained_in ( self )
@@ -310,11 +312,10 @@ impl FuriString {
310
312
///
311
313
/// Returns `false` if it does not.
312
314
///
313
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
315
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
314
316
/// [`char`]s.
315
317
///
316
318
/// [`char`]: prim@char
317
- /// [pattern]: self::pattern
318
319
pub fn starts_with < P : Pattern > ( & self , pat : P ) -> bool {
319
320
pat. is_prefix_of ( self )
320
321
}
@@ -323,11 +324,10 @@ impl FuriString {
323
324
///
324
325
/// Returns `false` if it does not.
325
326
///
326
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
327
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
327
328
/// [`char`]s.
328
329
///
329
330
/// [`char`]: prim@char
330
- /// [pattern]: self::pattern
331
331
pub fn ends_with < P : Pattern > ( & self , pat : P ) -> bool {
332
332
pat. is_suffix_of ( self )
333
333
}
@@ -336,11 +336,10 @@ impl FuriString {
336
336
///
337
337
/// Returns [`None`] if the pattern doesn't match.
338
338
///
339
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
339
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
340
340
/// [`char`]s.
341
341
///
342
342
/// [`char`]: prim@char
343
- /// [pattern]: self::pattern
344
343
#[ inline]
345
344
pub fn find < P : Pattern > ( & self , pat : P ) -> Option < usize > {
346
345
pat. find_in ( self )
@@ -351,11 +350,10 @@ impl FuriString {
351
350
///
352
351
/// Returns [`None`] if the pattern doesn't match.
353
352
///
354
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
353
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
355
354
/// [`char`]s.
356
355
///
357
356
/// [`char`]: prim@char
358
- /// [pattern]: self::pattern
359
357
#[ inline]
360
358
pub fn rfind < P : Pattern > ( & self , pat : P ) -> Option < usize > {
361
359
pat. rfind_in ( self )
@@ -404,23 +402,21 @@ impl FuriString {
404
402
405
403
/// Repeatedly removes from this string all prefixes and suffixes that match a pattern.
406
404
///
407
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
405
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
408
406
/// [`char`]s.
409
407
///
410
408
/// [`char`]: prim@char
411
- /// [pattern]: self::pattern
412
409
pub fn trim_matches < P : Pattern + Copy > ( & mut self , pat : P ) {
413
410
self . trim_start_matches ( pat) ;
414
411
self . trim_end_matches ( pat) ;
415
412
}
416
413
417
414
/// Repeatedly removes from this string all prefixes that match a pattern.
418
415
///
419
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
416
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
420
417
/// [`char`]s.
421
418
///
422
419
/// [`char`]: prim@char
423
- /// [pattern]: self::pattern
424
420
///
425
421
/// # Text directionality
426
422
///
@@ -434,11 +430,10 @@ impl FuriString {
434
430
435
431
/// Repeatedly removes from this string all suffixes that match a pattern.
436
432
///
437
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
433
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
438
434
/// [`char`]s.
439
435
///
440
436
/// [`char`]: prim@char
441
- /// [pattern]: self::pattern
442
437
///
443
438
/// # Text directionality
444
439
///
@@ -457,11 +452,10 @@ impl FuriString {
457
452
///
458
453
/// If the string does not start with `prefix`, returns `false`.
459
454
///
460
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
455
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
461
456
/// [`char`]s.
462
457
///
463
458
/// [`char`]: prim@char
464
- /// [pattern]: self::pattern
465
459
#[ must_use]
466
460
pub fn strip_prefix < P : Pattern > ( & mut self , prefix : P ) -> bool {
467
461
prefix. strip_prefix_of ( self )
@@ -474,11 +468,10 @@ impl FuriString {
474
468
///
475
469
/// If the string does not end with `suffix`, returns `false`.
476
470
///
477
- /// The [ pattern] can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
471
+ /// The pattern can be a `&FuriString`, [`c_char`], `&CStr`, [`char`], or a slice of
478
472
/// [`char`]s.
479
473
///
480
474
/// [`char`]: prim@char
481
- /// [pattern]: self::pattern
482
475
#[ must_use]
483
476
pub fn strip_suffix < P : Pattern > ( & mut self , suffix : P ) -> bool {
484
477
suffix. strip_suffix_of ( self )
0 commit comments