avoid copy
This commit is contained in:
		
							parent
							
								
									3d94670f1f
								
							
						
					
					
						commit
						dc4654fa4c
					
				| @ -40,7 +40,8 @@ impl Web3 for Web3Client { | ||||
| 	fn sha3(&self, params: Params) -> Result<Value, Error> { | ||||
| 		from_params::<(Bytes,)>(params).and_then( | ||||
| 			|(data,)| { | ||||
| 				let sha3 = data.to_vec().sha3(); | ||||
| 				let Bytes(ref v) = data; | ||||
| 				let sha3 = v.sha3(); | ||||
| 				to_value(&sha3) | ||||
| 			} | ||||
| 		) | ||||
|  | ||||
| @ -21,7 +21,7 @@ use util::common::FromHex; | ||||
| 
 | ||||
| /// Wrapper structure around vector of bytes.
 | ||||
| #[derive(Debug, PartialEq, Default)] | ||||
| pub struct Bytes(Vec<u8>); | ||||
| pub struct Bytes(pub Vec<u8>); | ||||
| 
 | ||||
| impl Bytes { | ||||
| 	/// Simple constructor.
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user