Silence fuzz build unused import warnings
[rust-lightning] / fuzz / src / bin / target_template.txt
index ae2130a9cc2c314fb9fea28bf44578a3be33e1a7..2dcf22712cb485042536d4de1f1acce5e69e2206 100644 (file)
@@ -6,9 +6,6 @@
 extern crate lightning_fuzz;
 use lightning_fuzz::TARGET_MOD::*;
 
-use std::fs;
-use std::io::Read;
-
 #[cfg(feature = "afl")]
 #[macro_use] extern crate afl;
 #[cfg(feature = "afl")]
@@ -38,6 +35,8 @@ fuzz_target!(|data: &[u8]| {
 
 #[cfg(feature = "stdin_fuzz")]
 fn main() {
+       use std::io::Read;
+
        let mut data = Vec::with_capacity(8192);
        std::io::stdin().read_to_end(&mut data).unwrap();
        TARGET_NAME_run(data.as_ptr(), data.len());
@@ -45,6 +44,8 @@ fn main() {
 
 #[test]
 fn run_test_cases() {
+       use std::fs;
+       use std::io::Read;
        use lightning_fuzz::utils::test_logger::StringBuffer;
 
        use std::sync::{atomic, Arc};