Fix everything.

This commit is contained in:
Gav
2018-01-27 13:32:30 +01:00
parent a9c864e098
commit ace1387076
10 changed files with 154 additions and 55 deletions
@@ -105,6 +105,28 @@ pub fn with_externalities<R, F: FnOnce() -> R>(ext: &mut Externalities, f: F) ->
ext::using(ext, f)
}
pub trait Printable {
fn print(self);
}
impl<'a> Printable for &'a [u8] {
fn print(self) {
if let Ok(s) = ::std::str::from_utf8(self) {
println!("Runtime: {}", s);
}
}
}
impl Printable for u64 {
fn print(self) {
println!("Runtime: {}", self);
}
}
pub fn print<T: Printable + Sized>(value: T) {
value.print();
}
#[macro_export]
macro_rules! impl_stubs {
($( $name:ident ),*) => {}