fn parse_cooked_content(mut s: &[u8]) -> Vec<u8> {
    s = &s[1..s.iter().rposition(|b| *b == b'"').unwrap()];
    let mut result = Vec::new();
    while !s.is_empty() {
        match s[0] {
            b'\\' => {}
            b'\r' => {
                assert_eq!(s[1], b'\n');
                result.push(b'\n');
                s = &s[2..];
                continue;
            }
            b => {
                result.push(b);
                s = &s[1..];
                continue;
            }
        }
        let b = s[1];
        s = &s[2..];
        match b {
            b'x' => {
                let (b, rest) = backslash_x(&s);
                result.push(b);
                s = rest;
            }
            b'u' => {
                let (c, rest) = backslash_u(&s);
                result.extend_from_slice(c.encode_utf8(&mut [0; 4]).as_bytes());
                s = rest;
            }
            b'n' => result.push(b'\n'),
            b'r' => result.push(b'\r'),
            b't' => result.push(b'\t'),
            b'\\' => result.push(b'\\'),
            b'0' => result.push(b'\0'),
            b'\'' => result.push(b'\''),
            b'"' => result.push(b'"'),
            b'\r' | b'\n' => {
                let next = s.iter().position(|b| {
                    let ch = char::from_u32(u32::from(*b)).unwrap();
                    !ch.is_whitespace()
                });
                match next {
                    Some(pos) => s = &s[pos..],
                    None => s = b"",
                }
            }
            b => panic!("unexpected byte {:?} after \\", b),
        }
    }
    result
}
/// Parses the cooked string / bytes content within quotes.
Parses the cooked string / bytes content within quotes.
Parses the cooked string / bytes content within quotes .
fn parse_cooked_content(mut s: &[u8]) -> Vec<u8> {
    s = &s[1..s.iter().rposition(|b| *b == b'"').unwrap()];
    let mut result = Vec::new();
    while !s.is_empty() {
        match s[0] {
            b'\\' => {}
            b'\r' => {
                assert_eq!(s[1], b'\n');
                result.push(b'\n');
                s = &s[2..];
                continue;
            }
            b => {
                result.push(b);
                s = &s[1..];
                continue;
            }
        }
        let b = s[1];
        s = &s[2..];
        match b {
            b'x' => {
                let (b, rest) = backslash_x(&s);
                result.push(b);
                s = rest;
            }
            b'u' => {
                let (c, rest) = backslash_u(&s);
                result.extend_from_slice(c.encode_utf8(&mut [0; 4]).as_bytes());
                s = rest;
            }
            b'n' => result.push(b'\n'),
            b'r' => result.push(b'\r'),
            b't' => result.push(b'\t'),
            b'\\' => result.push(b'\\'),
            b'0' => result.push(b'\0'),
            b'\'' => result.push(b'\''),
            b'"' => result.push(b'"'),
            b'\r' | b'\n' => {
                let next = s.iter().position(|b| {
                    let ch = char::from_u32(u32::from(*b)).unwrap();
                    !ch.is_whitespace()
                });
                match next {
                    Some(pos) => s = &s[pos..],
                    None => s = b"",
                }
            }
            b => panic!("unexpected byte {:?} after \\", b),
        }
    }
    result
}
fn parse_cooked_content ( mut s : & [ u8 ] ) -> Vec < u8 > { s = & s [ 1 .. s . iter ( ) . rposition ( | b | * b == b'"' ) . unwrap ( ) ] ; let mut result = Vec :: new ( ) ; while ! s . is_empty ( ) { match s [ 0 ] { b'\\' => { } b'\r' => { assert_eq ! ( s [ 1 ] b'\n' ) ; result . push ( b'\n' ) ; s = & s [ 2 .. ] ; continue ; } b => { result . push ( b ) ; s = & s [ 1 .. ] ; continue ; } } let b = s [ 1 ] ; s = & s [ 2 .. ] ; match b { b'x' => { let ( b , rest ) = backslash_x ( & s ) ; result . push ( b ) ; s = rest ; } b'u' => { let ( c , rest ) = backslash_u ( & s ) ; result . extend_from_slice ( c . encode_utf8 ( & mut [ 0 ; 4 ] ) . as_bytes ( ) ) ; s = rest ; } b'n' => result . push ( b'\n' ) , b'r' => result . push ( b'\r' ) , b't' => result . push ( b'\t' ) , b'\\' => result . push ( b'\\' ) , b'0' => result . push ( b'\0' ) , b'\'' => result . push ( b'\'' ) , b'"' => result . push ( b'"' ) , b'\r' | b'\n' => { let next = s . iter ( ) . position ( | b | { let ch = char :: from_u32 ( u32 :: from ( * b ) ) . unwrap ( ) ; ! ch . is_whitespace ( ) } ) ; match next { Some ( pos ) => s = & s [ pos .. ] , None => s = b" " , } } b => panic ! ( " \\ " b ) , } } result }
Parses the cooked string / bytes content within quotes.
Parses the cooked string / bytes content within quotes .
s
&[u8]
s
&[u8]