pub fn parse_all<T: ToString>(text: T) -> HashSet<String> {
        let input = text.to_string();
        let mut remaining = input.as_str();
        let mut paths = HashSet::new();
        while !remaining.is_empty() {
            match Self::parse(remaining) {
                Ok((next_remaining, path)) => {
                    paths.insert(path.to_string());
                    remaining = next_remaining;
                }
                Err(_) => {
                    // If parsing fails, we can assume that the remaining string
                    // does not contain any more valid attachments.
                    break;
                }
            }
        }

        paths
    }
Parses a string and extracts all file paths in the format
@[path/to/file]. File paths can contain spaces and are considered to
extend until the closing bracket. If the closing bracket is missing,
consider everything until the end of the string as the path.
crates/forge_domain/src/attachment.rs