avoid allocating string

This commit is contained in:
NikVolf 2017-03-25 23:30:11 +03:00
parent 434ed1b91c
commit 34fb39da5b
2 changed files with 3 additions and 3 deletions

View File

@ -28,11 +28,11 @@ use ethkey::{Signature, recover as ec_recover};
use ethjson;
#[derive(Debug)]
pub struct Error(pub String);
pub struct Error(pub &'static str);
impl From<&'static str> for Error {
fn from(val: &'static str) -> Self {
Error(val.to_owned())
Error(val)
}
}

View File

@ -61,7 +61,7 @@ pub enum Error {
limit: usize
},
/// Built-in contract failed on given input
BuiltIn(String),
BuiltIn(&'static str),
/// Returned on evm internal error. Should never be ignored during development.
/// Likely to cause consensus issues.
Internal(String),