summaryrefslogtreecommitdiffstats
path: root/ffi
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-05-07 18:22:04 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-05-07 18:24:56 +0200
commitca35fe181ed578f1fb4047de8dd8ea7595daec0d (patch)
tree7d5edf0babac6a79bf091f3a8b164ca779c4c002 /ffi
parent8ed5842580a1c172fc8d5ebe5d0444ee5e011a01 (diff)
openpgp-ffi, ffi: Improve 6911aed9.
- To preserve location information, replace the include.
Diffstat (limited to 'ffi')
-rw-r--r--ffi/tests/c-tests.rs4
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() {