diff options
Diffstat (limited to 'ffi/tests/c-tests.rs')
-rw-r--r-- | ffi/tests/c-tests.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ffi/tests/c-tests.rs b/ffi/tests/c-tests.rs index 66cda46f..a5bd1f67 100644 --- a/ffi/tests/c-tests.rs +++ b/ffi/tests/c-tests.rs @@ -266,7 +266,9 @@ fn wrap_with_main(test: &mut Vec<String>, offset: usize) { let needs_wrapping = ! has_main(test); // Replace glibc-style error handling. - test.retain(|l| l != "#include <error.h>"); + test.iter_mut().for_each(|l| { + if l == "#include <error.h>" { *l = "".into() } + }); let mut last_include = 0; for (n, line) in test.iter().enumerate() { |