(
binary: &'a str,
tokens: &mut Peekable<I>,
)
| 90 | } |
| 91 | |
| 92 | fn parse_cmd<I: Iterator<Item = &'a str>>( |
| 93 | binary: &'a str, |
| 94 | tokens: &mut Peekable<I>, |
| 95 | ) -> Option<Cmd<'a>> { |
| 96 | let mut args: Vec<&str> = vec![]; |
| 97 | loop { |
| 98 | let next = tokens.peek(); |
| 99 | match next { |
| 100 | Some(token) if Self::is_operator(token) => { |
| 101 | // found operator, so I already parsed all cmd |
| 102 | break; |
| 103 | } |
| 104 | Some(token) => { |
| 105 | args.push(token); |
| 106 | } |
| 107 | None => break, |
| 108 | } |
| 109 | tokens.next(); |
| 110 | } |
| 111 | Some(Cmd { binary, args }) |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | impl<'a> Cmd<'a> { |
nothing calls this directly
no outgoing calls
no test coverage detected