no_std again

This commit is contained in:
Dominik Maier 2020-12-11 01:08:26 +01:00
parent 479dd4fc59
commit 1af7b204bc
6 changed files with 14 additions and 5 deletions

View File

@ -352,10 +352,14 @@ where
phantom: PhantomData<(C, E, I, R)>, phantom: PhantomData<(C, E, I, R)>,
} }
#[cfg(feature = "std")]
/// Forward this to the client /// Forward this to the client
const LLMP_TAG_EVENT_TO_CLIENT: llmp::Tag = 0x2C11E471; const LLMP_TAG_EVENT_TO_CLIENT: llmp::Tag = 0x2C11E471;
#[cfg(feature = "std")]
/// Only handle this in the broker /// Only handle this in the broker
const LLMP_TAG_EVENT_TO_BROKER: llmp::Tag = 0x2B80438; const LLMP_TAG_EVENT_TO_BROKER: llmp::Tag = 0x2B80438;
#[cfg(feature = "std")]
/// Handle in both
const LLMP_TAG_EVENT_TO_BOTH: llmp::Tag = 0x2B0741; const LLMP_TAG_EVENT_TO_BOTH: llmp::Tag = 0x2B0741;
/// Eventmanager for multi-processed application /// Eventmanager for multi-processed application

View File

@ -1,3 +1,5 @@
use alloc::string::String;
use alloc::string::ToString;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::marker::PhantomData; use core::marker::PhantomData;
use num::Integer; use num::Integer;
@ -153,7 +155,7 @@ where
pub fn new_with_observer(map_observer: &O) -> Self { pub fn new_with_observer(map_observer: &O) -> Self {
Self { Self {
history_map: vec![T::default(); map_observer.map().len()], history_map: vec![T::default(); map_observer.map().len()],
name: map_observer.name().into(), name: map_observer.name().to_string(),
phantom: PhantomData, phantom: PhantomData,
} }
} }
@ -170,7 +172,7 @@ where
pub fn with_history_map(name: &'static str, history_map: Vec<T>) -> Self { pub fn with_history_map(name: &'static str, history_map: Vec<T>) -> Self {
Self { Self {
history_map: history_map, history_map: history_map,
name: name.to_string(), name: name.into(),
phantom: PhantomData, phantom: PhantomData,
} }
} }

View File

@ -3,6 +3,7 @@ pub use bytes::BytesInput;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::clone::Clone; use core::clone::Clone;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[cfg(feature = "std")] #[cfg(feature = "std")]

View File

@ -72,7 +72,7 @@ impl fmt::Display for AflError {
/// Stringify the postcard serializer error /// Stringify the postcard serializer error
impl From<postcard::Error> for AflError { impl From<postcard::Error> for AflError {
fn from(err: postcard::Error) -> Self { fn from(err: postcard::Error) -> Self {
Self::Serialize(err.to_string()) Self::Serialize(format!("{:?}", err))
} }
} }

View File

@ -1,6 +1,7 @@
extern crate num; extern crate num;
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::string::String;
use core::any::Any; use core::any::Any;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@ -133,7 +134,7 @@ where
Self { Self {
map: ArrayMut::Cptr((map.as_mut_ptr(), map.len())), map: ArrayMut::Cptr((map.as_mut_ptr(), map.len())),
initial: initial, initial: initial,
name: name.to_string(), name: name.into(),
} }
} }
@ -145,7 +146,7 @@ where
StdMapObserver { StdMapObserver {
map: ArrayMut::Cptr((map_ptr, len)), map: ArrayMut::Cptr((map_ptr, len)),
initial: initial, initial: initial,
name: name.to_string(), name: name.into(),
} }
} }
} }

View File

@ -61,6 +61,7 @@ macro_rules! create_serde_registry_for_trait {
pub mod $mod_name { pub mod $mod_name {
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::string::String;
use core::any::{Any, TypeId}; use core::any::{Any, TypeId};
use core::fmt; use core::fmt;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};