fixed no_std
This commit is contained in:
parent
8e512a68b5
commit
0cc389f952
@ -27,7 +27,7 @@ pub mod tuples;
|
||||
pub mod utils;
|
||||
|
||||
use alloc::string::String;
|
||||
use core::fmt;
|
||||
use core::{fmt, marker::PhantomData};
|
||||
use corpus::Corpus;
|
||||
use events::EventManager;
|
||||
use executors::{Executor, HasObservers};
|
||||
@ -36,10 +36,10 @@ use inputs::Input;
|
||||
use observers::ObserversTuple;
|
||||
use stages::StagesTuple;
|
||||
use state::{HasCorpus, State};
|
||||
use std::marker::PhantomData;
|
||||
use utils::{current_milliseconds, Rand};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use std::{env::VarError, io, num::ParseIntError, string::FromUtf8Error};
|
||||
use utils::{current_milliseconds, Rand};
|
||||
|
||||
/// The main fuzzer trait.
|
||||
pub trait Fuzzer<C, E, EM, FT, ST, I, OT, R>
|
||||
|
@ -6,9 +6,13 @@ use crate::{
|
||||
AflError,
|
||||
};
|
||||
|
||||
use std::fs::File;
|
||||
use alloc::{borrow::ToOwned, vec::Vec};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use std::io::{BufRead, BufReader};
|
||||
use std::{
|
||||
fs::File,
|
||||
std::io::{BufRead, BufReader},
|
||||
};
|
||||
|
||||
const ARITH_MAX: u64 = 35;
|
||||
|
||||
@ -816,6 +820,7 @@ pub fn add_token_to_dictionary(dict: &mut Vec<Vec<u8>>, token: &Vec<u8>) -> u32
|
||||
}
|
||||
|
||||
/// Read a dictionary file and return the number of entries read
|
||||
#[cfg(feature = "std")]
|
||||
pub fn read_dict_file(f: &str, dict: &mut Vec<Vec<u8>>) -> Result<u32, AflError> {
|
||||
let mut entries = 0;
|
||||
|
||||
@ -878,10 +883,13 @@ pub fn read_dict_file(f: &str, dict: &mut Vec<Vec<u8>>) -> Result<u32, AflError>
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[cfg(feature = "std")]
|
||||
use std::fs;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use crate::mutators::read_dict_file;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[test]
|
||||
fn test_read_dict() {
|
||||
let _ = fs::remove_file("test.dict");
|
||||
|
Loading…
x
Reference in New Issue
Block a user