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: parser.rs
    path of file: ./repos/fastn/ftd/src/p1
    
    the code of the file until where you have to start completion: #[derive(Debug, Clone)]
enum ParsingStateReading {
    Section,
    Header {
        key: String,
        caption: Option<String>,
        kind: Option<String>,
        condition: Option<String>,
        line_number: usize,
    },
    Caption,
    Body,
    Subsection,
}

#[derive(Debug)]
pub struct State {
    line_number: i32,
    sections: Vec<ftd::p1::Section>,
    content: String,
    doc_id: String,
    state: Vec<(ftd::p1::Section, Vec<ParsingStateReading>)>,
}

impl State {
    fn next(&mut self) -> ftd::p1::Result<()> {
        use itertools::Itertools;

        self.reading_section()?;

        while let Some((_, mut state)) = self.get_latest_state() {
            let mut change_state = None;
            self.end(&mut change_state)?;

            if self.content.trim().is_empty() {
                let sections = self.state.iter().map(|(v, _)| v.clone()).collect_vec();
                self.state = vec![];
                self.sections.extend(sections);

                continue;
            }

            if let Some
    
fn remove_inline_comments(line: &str) -> String {
    let mut output = String::new();
    let mut chars = line.chars().peekable();
    let mut escape = false;
    let mut count = 0;

    while let Some(c) = chars.next() {
        if c.eq(&'\\') {
            if !escape {
                escape = true;
            }

            count += 1;

            if let Some(nc) = chars.peek() {
                if nc.eq(&';') {
                    output.push(';');
                    chars.next();
                    continue;
                } else if nc.ne(&'\\') {
                    escape = false;
                    count = 0;
                }
            }
        }

        if c.eq(&';') {
            if escape {
                if count % 2 == 0 {
                    output.pop();
                    break;
                } else {
                    escape = false;
                    count = 0;
                }
            } else if let Some(nc) = chars.peek() {
                if nc.eq(&';') {
                    break;
                }
            }
        }

        if escape {
            escape = false;
            count = 0;
        }

        output.push(c);
    }

    output.to_string()
}