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 /openpgp-ffi | |
parent | 8ed5842580a1c172fc8d5ebe5d0444ee5e011a01 (diff) |
openpgp-ffi, ffi: Improve 6911aed9.
- To preserve location information, replace the include.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r-- | openpgp-ffi/tests/c-tests.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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() { |