Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix(compilation warnings)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasad1 committed May 13, 2019
1 parent 2cf0d7d commit 8d20f71
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl Importer {
let (imported_blocks, import_results, invalid_blocks, imported, proposed_blocks, duration, has_more_blocks_to_import) = {
let mut imported_blocks = Vec::with_capacity(max_blocks_to_import);
let mut invalid_blocks = HashSet::new();
let mut proposed_blocks = Vec::with_capacity(max_blocks_to_import);
let proposed_blocks = Vec::with_capacity(max_blocks_to_import);
let mut import_results = Vec::with_capacity(max_blocks_to_import);

let _import_lock = self.import_lock.lock();
Expand Down
5 changes: 2 additions & 3 deletions ethcore/src/engines/clique/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ impl Clique {
"Back-filling block state. last_checkpoint_number: {}, target: {}({}).",
last_checkpoint_number, header.number(), header.hash());

let mut chain: &mut VecDeque<Header> = &mut VecDeque::with_capacity(
(header.number() - last_checkpoint_number + 1) as usize);
let mut chain = VecDeque::with_capacity((header.number() - last_checkpoint_number + 1) as usize);

// Put ourselves in.
chain.push_front(header.clone());
Expand Down Expand Up @@ -332,7 +331,7 @@ impl Clique {

// Backfill!
let mut new_state = last_checkpoint_state.clone();
for item in chain {
for item in &chain {
new_state.apply(item, false)?;
}
new_state.calc_next_timestamp(header.timestamp(), self.period)?;
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/ethereum/ethash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl Engine<EthereumMachine> for Arc<Ethash> {
let n_uncles = block.uncles.len();

// Bestow block rewards.
let mut result_block_reward = reward + reward.shr(5) * U256::from(n_uncles);
let result_block_reward = reward + reward.shr(5) * U256::from(n_uncles);

rewards.push((author, RewardKind::Author, result_block_reward));

Expand Down
2 changes: 1 addition & 1 deletion parity/informant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ impl<T: InformantData> Informant<T> {
let elapsed = now.duration_since(*self.last_tick.read());

let (client_report, full_report) = {
let mut last_report = self.last_report.lock();
let last_report = self.last_report.lock();
let full_report = self.target.report();
let diffed = full_report.client_report.clone() - &*last_report;
(diffed, full_report)
Expand Down
8 changes: 4 additions & 4 deletions rpc/src/tests/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,20 @@ pub fn request(address: &SocketAddr, request: &str) -> Response {
pub fn assert_security_headers_present(headers: &[String], port: Option<u16>) {
if port.is_none() {
assert!(
headers.iter().any(|header| header.as_str() == "X-Frame-Options: SAMEORIGIN")
headers.iter().any(|header| header.as_str() == "X-Frame-Options: SAMEORIGIN"),
"X-Frame-Options: SAMEORIGIN missing: {:?}", headers
);
}
assert!(
headers.iter().any(|header| header.as_str() == "X-XSS-Protection: 1; mode=block")
headers.iter().any(|header| header.as_str() == "X-XSS-Protection: 1; mode=block"),
"X-XSS-Protection missing: {:?}", headers
);
assert!(
headers.iter().any(|header| header.as_str() == "X-Content-Type-Options: nosniff")
headers.iter().any(|header| header.as_str() == "X-Content-Type-Options: nosniff"),
"X-Content-Type-Options missing: {:?}", headers
);
assert!(
headers.iter().any(|header| header.starts_with("Content-Security-Policy: "))
headers.iter().any(|header| header.starts_with("Content-Security-Policy: ")),
"Content-Security-Policy missing: {:?}", headers
)
}
2 changes: 1 addition & 1 deletion rpc/src/v1/helpers/dispatch/prospective_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl<P: PostSign> Future for ProspectiveSigner<P> {
.into_future());
},
WaitForPostSign => {
if let Some(mut fut) = self.post_sign_future.as_mut() {
if let Some(fut) = self.post_sign_future.as_mut() {
match fut.poll()? {
Async::Ready(item) => {
let nonce = self.ready
Expand Down
2 changes: 1 addition & 1 deletion util/network-devp2p/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ impl Host {

let socket = {
let address = {
let mut nodes = self.nodes.read();
let nodes = self.nodes.read();
if let Some(node) = nodes.get(id) {
node.endpoint.address
} else {
Expand Down
2 changes: 1 addition & 1 deletion whisper/src/rpc/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl EncryptionInstance {
EncryptionInner::AES(key, nonce, encode) => {
match encode {
AesEncode::AppendedNonce => {
let mut enc = Encryptor::aes_256_gcm(&*key).ok()?;
let enc = Encryptor::aes_256_gcm(&*key).ok()?;
let mut buf = enc.encrypt(&nonce, plain.to_vec()).ok()?;
buf.extend(&nonce[..]);
Some(buf)
Expand Down

0 comments on commit 8d20f71

Please sign in to comment.