Skip to content

Commit

Permalink
compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sakridge committed Apr 30, 2018
1 parent 4bfe61e commit e10d559
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
15 changes: 8 additions & 7 deletions src/crdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl ReplicatedData {
gossip_addr: SocketAddr,
replicate_addr: SocketAddr,
serve_addr: SocketAddr) -> ReplicatedData {
let daddr = "0.0.0.0:0".parse().unwrap();
let daddr:SocketAddr = "0.0.0.0:0".parse().unwrap();
ReplicatedData {
id,
sig: Signature::default(),
Expand Down Expand Up @@ -122,11 +122,11 @@ impl Crdt {
g.table.insert(me.id, me);
g
}
pub fn my_data(&self) -> ReplicatedData {
self.table[&self.me]
pub fn my_data(&self) -> &ReplicatedData {
&self.table[&self.me]
}
pub fn leader_data(&self) -> ReplicatedData {
self.table[&self.table[&self.me].current_leader_id]
pub fn leader_data(&self) -> &ReplicatedData {
&self.table[&self.table[&self.me].current_leader_id]
}
pub fn insert(&mut self, v: &ReplicatedData) {
// TODO check that last_verified types are always increasing
Expand All @@ -151,10 +151,11 @@ impl Crdt {
s: &UdpSocket,
transmit_index: &mut u64
) -> Result<()> {
let (me, table): (ReplicatedData, Vec<ReplicatedData>) = {
let (me, table): (&ReplicatedData, Vec<ReplicatedData>) = {
// copy to avoid locking durring IO
let robj = obj.read().unwrap();
(robj.table[&robj.me], robj.table.values().cloned().collect())
let cloned_table:Vec<ReplicatedData> = robj.table.values().cloned().collect();
(&cloned_table[&robj.me], cloned_table)
};
let errs: Vec<_> = table.iter()
.enumerate()
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg_attr(feature = "unstable", feature(test))]
pub mod accountant;
pub mod accountant_skel;
pub mod accountant_stub;
//pub mod accountant_skel;
//pub mod accountant_stub;
pub mod crdt;
pub mod ecdsa;
pub mod entry;
Expand Down
2 changes: 1 addition & 1 deletion src/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ fn broadcast(
#[cfg(feature = "erasure")]
erasure::generate_codes(blobs);
Crdt::broadcast(crdt, &blobs, &sock, transmit_index)?;
while let Some(b) = dq.pop_front() {
while let Some(b) = blobs.pop() {
recycler.recycle(b);
}
Ok(())
Expand Down

0 comments on commit e10d559

Please sign in to comment.