1#[macro_export]
4macro_rules! parse_output {
5 ($output:expr) => {
6 {
7 let output = $output;
8
9 if !output.status.success() {
10 return Err(BuildahError::Buildah(parse_output_line(output.stderr)));
11 }
12
13 parse_output_line(output.stdout)
14 }
15 };
16}
17
18pub fn parse_output_line(bytes: Vec<u8>) -> String {
21 let string = String::from_utf8(bytes).unwrap();
22 string.trim_end().to_string()
23}
24
25#[cfg(test)]
26mod tests {
27 #[test]
30 fn it_works() {
31 assert_eq!(2 + 2, 4);
32 }
33}