|
|
@ -22,17 +22,12 @@ fn main() { |
|
|
|
.iter() |
|
|
|
.iter() |
|
|
|
.position(|s| s.starts_with("--message-format")) |
|
|
|
.position(|s| s.starts_with("--message-format")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
input.cargo_opts.remove(pos); |
|
|
|
let arg = input.cargo_opts.remove(pos); |
|
|
|
let format = if let Some((_, format)) = input |
|
|
|
let format = if let Some((_, format)) = arg.split_once('=') |
|
|
|
.cargo_opts |
|
|
|
|
|
|
|
.get(pos) |
|
|
|
|
|
|
|
.unwrap() |
|
|
|
|
|
|
|
.to_string() |
|
|
|
|
|
|
|
.split_once('=') |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
format.to_string() |
|
|
|
format.to_string() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
input.cargo_opts.remove(pos).to_string() |
|
|
|
arg.to_string() |
|
|
|
}; |
|
|
|
}; |
|
|
|
if !format.starts_with("json") { |
|
|
|
if !format.starts_with("json") { |
|
|
|
eprintln!("error: non-JSON `message-format` is not supported"); |
|
|
|
eprintln!("error: non-JSON `message-format` is not supported"); |
|
|
|