diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-05-07 18:22:04 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-05-07 18:24:56 +0200 |
commit | ca35fe181ed578f1fb4047de8dd8ea7595daec0d (patch) | |
tree | 7d5edf0babac6a79bf091f3a8b164ca779c4c002 | |
parent | 8ed5842580a1c172fc8d5ebe5d0444ee5e011a01 (diff) |
openpgp-ffi, ffi: Improve 6911aed9.
- To preserve location information, replace the include.
-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() { |