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: matched_string.rs
    path of file: ./repos/broot/src/display
    
    the code of the file until where you have to start completion: use {
    super::{CropWriter, SPACE_FILLING},
    crate::pattern::NameMatch,
    termimad::{
        minimad::Alignment,
        CompoundStyle, StrFit,
    },
    unicode_width::{UnicodeWidthChar, UnicodeWidthStr},
};

pub struct MatchedString<'a> {
    pub name_match: Option<NameMatch>,
    pub string: &'a str,
    pub base_style: &'a CompoundStyle,
    pub match_style: &'a CompoundStyle,
    pub display_width: Option<usize>,
    pub align: Alignment,
}

impl<'a, 'w> MatchedString<'a> {

    pub fn new(
        name_match: Option<NameMatch>,
        string: &'a str,
        base_style: &'a CompoundStyle,
        match_
    
    pub fn split_on_last(&mut self, sep: char) -> Option<Self> {
        if self.display_width.is_some() {
            // the proper algo would need measuring the left part I guess
            None
        } else {
            self.string
                .rfind(sep)
                .map(|sep_idx| {
                    let right = &self.string[sep_idx+1..];
                    self.string = &self.string[..sep_idx+1];
                    let left_chars_count = self.string.chars().count();
                    let right_name_match = self.name_match.as_mut()
                        .map(|nm| nm.cut_after(left_chars_count));
                    MatchedString {
                        name_match: right_name_match,
                        string: right,
                        base_style: self.base_style,
                        match_style: self.match_style,
                        display_width: None,
                        align: self.align,
                    }
                })
        }
    }