Merge pull request #1514 from ethcore/fix-warnings

Fix warnings
This commit is contained in:
Nikolay Volf
2016-07-01 14:55:17 +04:00
committed by GitHub
4 changed files with 13 additions and 11 deletions

View File

@@ -348,7 +348,7 @@ impl Client {
imported
}
fn commit_block<B>(&self, block: B, hash: &H256, block_data: &Bytes) -> ImportRoute where B: IsBlock + Drain {
fn commit_block<B>(&self, block: B, hash: &H256, block_data: &[u8]) -> ImportRoute where B: IsBlock + Drain {
let number = block.header().number();
// Are we committing an era?
let ancient = if number >= HISTORY {

View File

@@ -52,10 +52,10 @@ impl WorkPoster {
}
fn create_client() -> Client<PostHandler> {
let client = Client::<PostHandler>::configure()
Client::<PostHandler>::configure()
.keep_alive(true)
.build().expect("Error creating HTTP client") as Client<PostHandler>;
client
.build()
.expect("Error creating HTTP client")
}
pub fn notify(&self, pow_hash: H256, difficulty: U256, number: u64) {
@@ -63,8 +63,10 @@ impl WorkPoster {
let target = Ethash::difficulty_to_boundary(&difficulty);
let seed_hash = &self.seed_compute.lock().unwrap().get_seedhash(number);
let seed_hash = H256::from_slice(&seed_hash[..]);
let body = format!(r#"{{ "result": ["0x{}","0x{}","0x{}","0x{:x}"] }}"#,
pow_hash.hex(), seed_hash.hex(), target.hex(), number);
let body = format!(
r#"{{ "result": ["0x{}","0x{}","0x{}","0x{:x}"] }}"#,
pow_hash.hex(), seed_hash.hex(), target.hex(), number
);
let mut client = self.client.lock().unwrap();
for u in &self.urls {
if let Err(e) = client.request(u.clone(), PostHandler { body: body.clone() }) {
@@ -104,12 +106,12 @@ impl hyper::client::Handler<HttpStream> for PostHandler {
}
fn on_response_readable(&mut self, _decoder: &mut hyper::Decoder<HttpStream>) -> Next {
Next::end()
Next::end()
}
fn on_error(&mut self, err: hyper::Error) -> Next {
fn on_error(&mut self, err: hyper::Error) -> Next {
trace!("Error posting work data: {}", err);
Next::end()
}
}
}