From 90645e30a6db01f2938744f8e8e535c489e5e799 Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 13 Jan 2016 22:05:10 +0100 Subject: [PATCH] update pr to use From::from --- src/json_aid.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/json_aid.rs b/src/json_aid.rs index c0b5a5180..d015bb13c 100644 --- a/src/json_aid.rs +++ b/src/json_aid.rs @@ -18,17 +18,7 @@ pub fn bytes_from_json(json: &Json) -> Bytes { } pub fn address_from_json(json: &Json) -> Address { - address_from_str(json.as_string().unwrap_or("0000000000000000000000000000000000000000")) -} - -pub fn address_from_str<'a>(s: &'a str) -> Address { - if s.len() == 0 { - Address::new() - } else if s.len() % 2 == 1 { - address_from_hex(&("0".to_string() + &(clean(s).to_string()))[..]) - } else { - address_from_hex(clean(s)) - } + From::from(json.as_string().unwrap_or("0000000000000000000000000000000000000000")) } pub fn h256_from_json(json: &Json) -> H256 {