diff options
-rw-r--r-- | ffi/tests/c-tests.rs | 4 | ||||
-rw-r--r-- | openpgp-ffi/tests/c-tests.rs | 4 |
2 files changed, 6 insertions, 2 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() { diff --git a/openpgp-ffi/tests/c-tests.rs b/openpgp-ffi/tests/c-tests.rs index b14ecadb..06ab21a5 100644 --- a/openpgp-ffi/tests/c-tests.rs +++ b/openpgp-ffi/tests/c-tests.rs @@ -265,7 +265,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() { |