INNER CODE UNIT · Rust

parse_identifier

steineggerlab/folddisco · lib/pdbtbx-cif/src/lib.rs:342

fn parse_identifier<'a>(input: &mut Position<'a>) -> &'a str {
    let mut chars_to_remove = 0;

    for c in input.text.chars() {
        if c.is_ascii_whitespace() {
            let identifier = &input.text[..chars_to_remove];
            input.text = &input.text[chars_to_remove..];
            input.column += chars_to_remove;
            return identifier;
        }
        chars_to_remove += 1;
    }

    let identifier = input.text;
    input.text = "";
    input.column += chars_to_remove;
    identifier
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…