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: pattern.rs
    path of file: ./repos/ruffle/wstr/src
    
    the code of the file until where you have to start completion: //! Like [`core::str::pattern::Pattern`], but for [`WStr`].

// TODO: Is performance good? ideas for improvements:
//  - add some inlines?
//  - remove implicit bound checks?
//  - use memchr crate?

use super::{Units, WStr};

/// A pattern that can be searched in a [`WStr`].
///
/// - `WStr` searches for the given string.
/// - `u8
    
    fn next_back(&mut self) -> SearchStep {
        if self.front > self.back {
            return SearchStep::Done;
        }

        let start = self.back;
        let end = self.back + self.needle.len();
        if &self.haystack[start..end] == self.needle {
            if let Some(back) = start.checked_sub(self.needle.len()) {
                self.back = back;
            } else {
                self.front = 1;
                self.back = 0;
            }
            SearchStep::Match(start, end)
        } else {
            if self.back == 0 {
                self.front = 1;
            } else {
                self.back -= 1;
            }
            SearchStep::Reject(end - 1, end)
        }
    }