Several more changes for librustc changes

This commit is contained in:
Andrew Poelstra 2015-04-04 13:08:49 -05:00
parent 467f76a37d
commit a62a7d736c
6 changed files with 10 additions and 8 deletions

View File

@ -13,6 +13,7 @@ git = "https://github.com/apoelstra/bitcoin-secp256k1-rs.git"
[dependencies]
byteorder = "*"
num_cpus = "*"
rand = "*"
rust-crypto = "*"
rustc-serialize = "*"

View File

@ -23,7 +23,7 @@
//!
use std::num::Zero;
use std::kinds::marker;
use std::marker;
use blockdata::block::{Block, BlockHeader};
use blockdata::transaction::Transaction;

View File

@ -20,10 +20,10 @@
use std::cmp;
use std::collections::HashMap;
use std::collections::hashmap::Entries;
use std::collections::hash::map::Iter;
use std::default::Default;
use std::mem;
use std::os::num_cpus;
use num_cpus;
use std::sync::Future;
use blockdata::transaction::{Transaction, TxOut};
@ -69,7 +69,7 @@ impl_consensus_encoding!(UtxoNode, height, outputs);
/// An iterator over UTXOs
pub struct UtxoIterator<'a> {
tx_iter: Entries<'a, Sha256dHash, UtxoNode>,
tx_iter: Iter<'a, Sha256dHash, UtxoNode>,
current_key: Sha256dHash,
current: Option<&'a UtxoNode>,
tx_index: u32
@ -261,7 +261,7 @@ impl UtxoSet {
let mut future_vec = Vec::with_capacity(block.txdata.len() - 1);
// skip the genesis since we don't validate this script. (TODO this might
// be a consensus bug since we don't even check that the opcodes make sense.)
let n_threads = cmp::min(block.txdata.len() - 1, num_cpus());
let n_threads = cmp::min(block.txdata.len() - 1, num_cpus::get());
for j in range(0, n_threads) {
let n_elems = block.txdata.len() - 1;
let start = 1 + j * n_elems / n_threads;

View File

@ -46,6 +46,7 @@ extern crate alloc;
extern crate byteorder;
extern crate collections;
extern crate core;
extern crate num_cpus;
extern crate rand;
extern crate rustc_serialize as serialize;
extern crate test;

View File

@ -22,7 +22,7 @@
use core::fmt::Debug;
use core::cmp;
use std::kinds::marker;
use std::marker;
use std::num::{Zero, One};
use network::encodable::{ConsensusDecodable, ConsensusEncodable};

View File

@ -21,7 +21,7 @@
use alloc::heap::{allocate, reallocate, deallocate};
use std::raw;
use std::slice::{Iter, MutIter};
use std::slice::{Iter, IterMut};
use std::{fmt, mem, ptr};
use std::u32;
@ -69,7 +69,7 @@ impl<T> ThinVec<T> {
/// Mutable iterator over elements of the vector
#[inline]
pub fn iter_mut<'a>(&'a mut self) -> MutIter<'a, T> {
pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, T> {
self.as_mut_slice().iter_mut()
}