cargo +nightly fmt

This commit is contained in:
Greg Fitzgerald
2018-05-08 18:59:01 -06:00
parent 785e971698
commit 1dca17fdb4
7 changed files with 15 additions and 15 deletions

View File

@ -10,9 +10,9 @@ use futures::Future;
use getopts::Options; use getopts::Options;
use isatty::stdin_isatty; use isatty::stdin_isatty;
use rayon::prelude::*; use rayon::prelude::*;
use solana::thin_client::ThinClient;
use solana::mint::MintDemo; use solana::mint::MintDemo;
use solana::signature::{KeyPair, KeyPairUtil}; use solana::signature::{KeyPair, KeyPairUtil};
use solana::thin_client::ThinClient;
use solana::transaction::Transaction; use solana::transaction::Transaction;
use std::env; use std::env;
use std::io::{stdin, Read}; use std::io::{stdin, Read};

View File

@ -7,12 +7,12 @@ extern crate solana;
use getopts::Options; use getopts::Options;
use isatty::stdin_isatty; use isatty::stdin_isatty;
use solana::accountant::Accountant; use solana::accountant::Accountant;
use solana::tpu::Tpu;
use solana::crdt::ReplicatedData; use solana::crdt::ReplicatedData;
use solana::entry::Entry; use solana::entry::Entry;
use solana::event::Event; use solana::event::Event;
use solana::historian::Historian; use solana::historian::Historian;
use solana::signature::{KeyPair, KeyPairUtil}; use solana::signature::{KeyPair, KeyPairUtil};
use solana::tpu::Tpu;
use std::env; use std::env;
use std::io::{stdin, stdout, Read}; use std::io::{stdin, stdout, Read};
use std::net::UdpSocket; use std::net::UdpSocket;

View File

@ -130,11 +130,11 @@ pub fn ed25519_verify(batches: &Vec<SharedPackets>) -> Vec<Vec<u8>> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use tpu::Request;
use bincode::serialize; use bincode::serialize;
use ecdsa; use ecdsa;
use packet::{Packet, Packets, SharedPackets}; use packet::{Packet, Packets, SharedPackets};
use std::sync::RwLock; use std::sync::RwLock;
use tpu::Request;
use transaction::test_tx; use transaction::test_tx;
use transaction::Transaction; use transaction::Transaction;

View File

@ -19,8 +19,8 @@ pub mod signature;
pub mod streamer; pub mod streamer;
pub mod thin_client; pub mod thin_client;
pub mod timing; pub mod timing;
pub mod transaction;
pub mod tpu; pub mod tpu;
pub mod transaction;
extern crate bincode; extern crate bincode;
extern crate byteorder; extern crate byteorder;
extern crate chrono; extern crate chrono;

View File

@ -3,7 +3,6 @@
//! messages to the network directly. The binary encoding of its messages are //! messages to the network directly. The binary encoding of its messages are
//! unstable and may change in future releases. //! unstable and may change in future releases.
use tpu::{Request, Response, Subscription};
use bincode::{deserialize, serialize}; use bincode::{deserialize, serialize};
use futures::future::{ok, FutureResult}; use futures::future::{ok, FutureResult};
use hash::Hash; use hash::Hash;
@ -11,6 +10,7 @@ use signature::{KeyPair, PublicKey, Signature};
use std::collections::HashMap; use std::collections::HashMap;
use std::io; use std::io;
use std::net::{SocketAddr, UdpSocket}; use std::net::{SocketAddr, UdpSocket};
use tpu::{Request, Response, Subscription};
use transaction::Transaction; use transaction::Transaction;
pub struct ThinClient { pub struct ThinClient {
@ -148,7 +148,6 @@ impl ThinClient {
mod tests { mod tests {
use super::*; use super::*;
use accountant::Accountant; use accountant::Accountant;
use tpu::Tpu;
use crdt::{Crdt, ReplicatedData}; use crdt::{Crdt, ReplicatedData};
use futures::Future; use futures::Future;
use historian::Historian; use historian::Historian;
@ -162,6 +161,7 @@ mod tests {
use std::thread::sleep; use std::thread::sleep;
use std::time::Duration; use std::time::Duration;
use std::time::Instant; use std::time::Instant;
use tpu::Tpu;
// TODO: Figure out why this test sometimes hangs on TravisCI. // TODO: Figure out why this test sometimes hangs on TravisCI.
#[test] #[test]

View File

@ -1,5 +1,5 @@
use std::time::{SystemTime, UNIX_EPOCH};
use std::time::Duration; use std::time::Duration;
use std::time::{SystemTime, UNIX_EPOCH};
pub fn duration_as_ms(d: &Duration) -> u64 { pub fn duration_as_ms(d: &Duration) -> u64 {
return (d.as_secs() * 1000) + (d.subsec_nanos() as u64 / 1_000_000); return (d.as_secs() * 1000) + (d.subsec_nanos() as u64 / 1_000_000);

View File

@ -11,6 +11,7 @@ use hash::Hash;
use historian::Historian; use historian::Historian;
use packet; use packet;
use packet::{SharedBlob, SharedPackets, BLOB_SIZE}; use packet::{SharedBlob, SharedPackets, BLOB_SIZE};
use rand::{thread_rng, Rng};
use rayon::prelude::*; use rayon::prelude::*;
use recorder::Signal; use recorder::Signal;
use result::Result; use result::Result;
@ -26,11 +27,10 @@ use std::sync::mpsc::{channel, Receiver, Sender, SyncSender};
use std::sync::{Arc, Mutex, RwLock}; use std::sync::{Arc, Mutex, RwLock};
use std::thread::{spawn, JoinHandle}; use std::thread::{spawn, JoinHandle};
use std::time::Duration; use std::time::Duration;
use streamer;
use transaction::Transaction;
use timing;
use std::time::Instant; use std::time::Instant;
use rand::{thread_rng, Rng}; use streamer;
use timing;
use transaction::Transaction;
pub struct Tpu { pub struct Tpu {
acc: Mutex<Accountant>, acc: Mutex<Accountant>,
@ -785,15 +785,13 @@ pub fn to_packets(r: &packet::PacketRecycler, reqs: Vec<Request>) -> Vec<SharedP
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use tpu::{to_packets, Request};
use bincode::serialize; use bincode::serialize;
use ecdsa; use ecdsa;
use packet::{BlobRecycler, PacketRecycler, BLOB_SIZE, NUM_PACKETS}; use packet::{BlobRecycler, PacketRecycler, BLOB_SIZE, NUM_PACKETS};
use tpu::{to_packets, Request};
use transaction::{memfind, test_tx}; use transaction::{memfind, test_tx};
use accountant::Accountant; use accountant::Accountant;
use tpu::Tpu;
use thin_client::ThinClient;
use chrono::prelude::*; use chrono::prelude::*;
use crdt::Crdt; use crdt::Crdt;
use crdt::ReplicatedData; use crdt::ReplicatedData;
@ -818,6 +816,8 @@ mod tests {
use std::thread::sleep; use std::thread::sleep;
use std::time::Duration; use std::time::Duration;
use streamer; use streamer;
use thin_client::ThinClient;
use tpu::Tpu;
use transaction::Transaction; use transaction::Transaction;
#[test] #[test]
@ -1126,7 +1126,6 @@ mod bench {
extern crate test; extern crate test;
use self::test::Bencher; use self::test::Bencher;
use accountant::{Accountant, MAX_ENTRY_IDS}; use accountant::{Accountant, MAX_ENTRY_IDS};
use tpu::*;
use bincode::serialize; use bincode::serialize;
use hash::hash; use hash::hash;
use mint::Mint; use mint::Mint;
@ -1134,6 +1133,7 @@ mod bench {
use std::collections::HashSet; use std::collections::HashSet;
use std::sync::mpsc::sync_channel; use std::sync::mpsc::sync_channel;
use std::time::Instant; use std::time::Instant;
use tpu::*;
use transaction::Transaction; use transaction::Transaction;
#[bench] #[bench]