File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -468,7 +468,8 @@ pub mod sz {
468
468
/// To convert uppercase ASCII characters to lowercase:
469
469
///
470
470
/// ```
471
- /// let mut to_lower = [0u8; 256];
471
+ /// use stringzilla::sz;
472
+ /// let mut to_lower: [u8; 256] = core::array::from_fn(|i| i as u8);
472
473
/// for (upper, lower) in ('A'..='Z').zip('a'..='z') {
473
474
/// to_lower[upper as usize] = lower as u8;
474
475
/// }
@@ -508,16 +509,16 @@ pub mod sz {
508
509
///
509
510
/// ```
510
511
/// use stringzilla::sz;
511
- /// let mut to_lower = [0u8 ; 256];
512
+ /// let mut to_lower: [u8 ; 256] = core::array::from_fn(|i| i as u8) ;
512
513
/// for (upper, lower) in ('A'..='Z').zip('a'..='z') {
513
514
/// to_lower[upper as usize] = lower as u8;
514
515
/// }
515
- /// let mut text = b"HELLO WORLD!";
516
+ /// let mut text = * b"HELLO WORLD!";
516
517
/// sz::lookup_inplace(&mut text, to_lower);
517
- /// assert_eq!(text, "hello world!");
518
+ /// assert_eq!(text, *b "hello world!");
518
519
/// ```
519
520
///
520
- pub fn lookup_inplace < T > ( buffer : & T , table : [ u8 ; 256 ] )
521
+ pub fn lookup_inplace < T > ( buffer : & mut T , table : [ u8 ; 256 ] )
521
522
where
522
523
T : AsMut < [ u8 ] > + ?Sized ,
523
524
{
You can’t perform that action at this time.
0 commit comments