You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: bytelines.rs
    path of file: ./repos/vim-clap/crates/utils/src
    
    the code of the file until where you have to start completion: //! A custom implementation of `lines()` method, display the non-utf8 line as well.

use memchr::{memchr, memrchr};
use std::borrow::Cow;
use std::iter::{DoubleEndedIterator, FusedIterator, Iterator};
use std::str;

/// Parses raw untrusted bytes into the strings.
#[derive(Clone)]
pub struct ByteLines<'a> {
    text: &'a [u8],
}
impl<'a> ByteLines<'a> {
    #[inline]
    pub fn new(text: &'a [u8]) -> Self {
        Self { text }
    }
}

/// New
    
    fn next(&mut self) -> Option<Self::Item> {
        let text = self.text;

        if text.is_empty() {
            return None;
        }

        let line = match memchr(NL, text) {
            Some(newline_idx) => {
                self.text = &text[newline_idx + 1..];
                &text[..newline_idx]
            }

            None => {
                // This line is the last one
                self.text = &[];
                text
            }
        };

        Some(match simdutf8::basic::from_utf8(line) {
            Ok(s) => s.into(),
            Err(_) => String::from_utf8_lossy(line),
        })
    }