av-decoders 0.5.0

Decoders for use in the rust-av ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[cfg_attr(not(feature = "vapoursynth"), allow(dead_code))]
pub(crate) fn escape_python_string(s: &str) -> String {
    s.chars()
        .map(|c| match c {
            '\\' => r"\\".to_string(),
            '"' => r#"\""#.to_string(),
            '\n' => r"\n".to_string(),
            '\r' => r"\r".to_string(),
            '\t' => r"\t".to_string(),
            c => c.to_string(),
        })
        .collect()
}