Skip to content

Commit 652da82

Browse files
committed
Run cargo fmt for v1.26
Now that there's a new version, there's a small change to the formatter. This updates the code base for that. Added a small disabling rustfmt: #[cfg_attr(rustfmt, rustfmt_skip)] Reference ticket: rust-lang/rustfmt#2695
1 parent 876e47f commit 652da82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+106
-105
lines changed

cli/src/account.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use clap::ArgMatches;
2-
use stellar_client::{sync, endpoint::account, sync::Client};
31
use super::{cursor, ordering, pager::Pager};
4-
use fmt::{Formatter, Simple};
2+
use clap::ArgMatches;
53
use error::Result;
4+
use fmt::{Formatter, Simple};
5+
use stellar_client::{sync, endpoint::account, sync::Client};
66

77
pub fn details(client: &Client, matches: &ArgMatches) -> Result<()> {
88
let id = matches.value_of("ID").expect("ID is required");

cli/src/assets.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use stellar_client::{endpoint::asset, sync::{self, Client}};
2-
use clap::ArgMatches;
31
use super::{cursor, ordering, pager::Pager};
2+
use clap::ArgMatches;
43
use error::Result;
54
use fmt::{Formatter, Simple};
5+
use stellar_client::{endpoint::asset, sync::{self, Client}};
66

77
/// Using a client and the arguments from the command line, iterates over the results
88
/// and displays them to the end user.

cli/src/effects.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use stellar_client::{endpoint::effect, sync::{self, Client}};
2-
use clap::ArgMatches;
31
use super::{cursor, ordering, pager::Pager};
2+
use clap::ArgMatches;
43
use error::Result;
54
use fmt::{Formatter, Simple};
5+
use stellar_client::{endpoint::effect, sync::{self, Client}};
66

77
/// Using a client and the arguments from the command line, iterates over the results
88
/// and displays them to the end user.

cli/src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use stellar_client::error::Error;
1+
use resolution::ParseResolutionError;
22
use std::error::Error as StdError;
33
use std::fmt;
44
use std::num::ParseIntError;
5-
use resolution::ParseResolutionError;
5+
use stellar_client::error::Error;
66

77
/// A result including client specific errors.
88
pub type Result<T> = ::std::result::Result<T, CliError>;

cli/src/fmt/simple/account.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::Account;
44

55
impl Render<Account> for Simple {

cli/src/fmt/simple/asset.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::Asset;
44

55
impl Render<Asset> for Simple {

cli/src/fmt/simple/effect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::{AssetIdentifier, effect::{Effect, EffectKind as Kind}};
44

55
impl Render<Effect> for Simple {

cli/src/fmt/simple/ledger.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::Ledger;
44

55
impl Render<Ledger> for Simple {

cli/src/fmt/simple/offer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::{AssetIdentifier, Offer};
44

55
fn render_asset(id: &AssetIdentifier) -> String {

cli/src/fmt/simple/orderbook.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::Orderbook;
44

55
impl Render<Orderbook> for Simple {

cli/src/fmt/simple/payment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::{Operation, OperationKind};
44

55
impl Render<Operation> for Simple {

cli/src/fmt/simple/trade_aggregation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::TradeAggregation;
44

55
impl Render<TradeAggregation> for Simple {

cli/src/fmt/simple/transaction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use fmt::Render;
21
use super::Simple;
2+
use fmt::Render;
33
use stellar_client::resources::Transaction;
44

55
impl Render<Transaction> for Simple {

cli/src/ledgers.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use stellar_client::{endpoint::ledger, sync::{self, Client}};
1+
use super::{cursor, ordering, pager::Pager};
22
use clap::ArgMatches;
33
use error::Result;
44
use fmt::{Formatter, Simple};
5-
use super::{cursor, ordering, pager::Pager};
5+
use stellar_client::{endpoint::ledger, sync::{self, Client}};
66

77
pub fn all(client: &Client, matches: &ArgMatches) -> Result<()> {
88
let pager = Pager::from_arg(&matches);

cli/src/main.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ extern crate clap;
55
extern crate stellar_client;
66

77
use clap::{App, AppSettings, Arg, SubCommand};
8+
use error::CliError;
89
use pager::Pager;
910
use stellar_client::{error::Error, sync::Client};
10-
use error::CliError;
1111

1212
mod account;
13-
mod assets;
1413
mod asset_identifier;
14+
mod assets;
1515
mod cursor;
1616
mod effects;
1717
mod error;
@@ -29,12 +29,8 @@ mod transactions;
2929
fn build_app<'a, 'b>() -> App<'a, 'b> {
3030
macro_rules! listable {
3131
($e:expr) => {
32-
Pager::add(
33-
ordering::add(
34-
cursor::add($e)
35-
)
36-
)
37-
}
32+
Pager::add(ordering::add(cursor::add($e)))
33+
};
3834
}
3935

4036
App::new("Stellar CLI")

cli/src/operations.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use stellar_client::{endpoint::operation, sync::{self, Client}};
2-
use clap::ArgMatches;
31
use super::{cursor, ordering, pager::Pager};
2+
use clap::ArgMatches;
43
use error::Result;
54
use fmt::{Formatter, Simple};
5+
use stellar_client::{endpoint::operation, sync::{self, Client}};
66

77
pub fn all(client: &Client, matches: &ArgMatches) -> Result<()> {
88
let pager = Pager::from_arg(&matches);

cli/src/payments.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use stellar_client::{endpoint::payment, sync::{self, Client}};
1+
use super::{cursor, ordering, pager::Pager};
22
use clap::ArgMatches;
33
use error::Result;
44
use fmt::{Formatter, Simple};
5-
use super::{cursor, ordering, pager::Pager};
5+
use stellar_client::{endpoint::payment, sync::{self, Client}};
66

77
pub fn all(client: &Client, matches: &ArgMatches) -> Result<()> {
88
let pager = Pager::from_arg(&matches);

cli/src/resolution.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::str::FromStr;
21
use self::Resolution::{Day, Hour, Min, Sec};
2+
use std::str::FromStr;
33

44
/// Represents durations of time for the trade aggregations endpoint.
55
pub enum Resolution {

cli/src/trades.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
use super::{cursor, ordering, pager::Pager};
12
use asset_identifier;
23
use chrono::{DateTime, Utc};
34
use clap::ArgMatches;
45
use error::Result;
56
use fmt::{Formatter, Simple};
67
use resolution::Resolution;
78
use stellar_client::{endpoint::trade, sync::{self, Client}};
8-
use super::{cursor, ordering, pager::Pager};
99

1010
pub fn all(client: &Client, matches: &ArgMatches) -> Result<()> {
1111
let pager = Pager::from_arg(&matches);

cli/src/transactions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use stellar_client::{endpoint::transaction, sync::{self, Client}};
2-
use clap::ArgMatches;
31
use super::{cursor, ordering, pager::Pager};
2+
use clap::ArgMatches;
43
use error::Result;
54
use fmt::{Formatter, Simple};
5+
use stellar_client::{endpoint::transaction, sync::{self, Client}};
66

77
pub fn all(client: &Client, matches: &ArgMatches) -> Result<()> {
88
let pager = Pager::from_arg(&matches);

client/src/client/async.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! This module contains the client for asynchronous communcation.
22
3+
use super::{Host, HORIZON_TEST_URI, HORIZON_URI};
4+
use error::{Error, Result};
5+
use http;
36
use hyper;
47
use hyper_tls::HttpsConnector;
5-
use http;
68
use tokio_core::reactor::Handle;
7-
use error::{Error, Result};
8-
use super::{Host, HORIZON_TEST_URI, HORIZON_URI};
99

1010
/// A client that can issue requests to a horizon api.
1111
#[derive(Debug, Clone)]

client/src/client/sync/iter.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use endpoint::{IntoRequest, Records};
2-
use uri::TryFromUri;
3-
use serde::de::DeserializeOwned;
41
use super::Client;
2+
use endpoint::{IntoRequest, Records};
53
use error::Result;
4+
use serde::de::DeserializeOwned;
5+
use uri::TryFromUri;
66

77
/// An iterator for records. Provides the ability to use the iterator
88
/// in rust against records that are returned from the api.

client/src/client/sync/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
//! let client = Client::new("https://horizon-testnet.stellar.org").unwrap();
1414
//! ```
1515
16-
use reqwest;
17-
use http::{self, Uri};
18-
use error::{Error, Result};
19-
use endpoint::IntoRequest;
2016
use super::{Host, HORIZON_TEST_URI, HORIZON_URI};
2117
use StellarError;
18+
use endpoint::IntoRequest;
19+
use error::{Error, Result};
20+
use http::{self, Uri};
21+
use reqwest;
2222
use serde_json;
2323

2424
mod iter;

client/src/endpoint/account.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Contains endpoints for accessing accounts and related information.
2-
use error::Result;
3-
use std::str::FromStr;
4-
use resources::{Account, Datum, Effect, Offer, Operation, Transaction};
52
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
3+
use error::Result;
64
use http::{Request, Uri};
5+
use resources::{Account, Datum, Effect, Offer, Operation, Transaction};
6+
use std::str::FromStr;
77
use uri::{self, TryFromUri, UriWrap};
88

99
/// Represents the account details on the stellar horizon server.

client/src/endpoint/asset.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Contains endpoints for assets and related information to specific assets.
2-
use error::Result;
3-
use std::str::FromStr;
4-
use resources::Asset;
52
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
3+
use error::Result;
64
use http::{Request, Uri};
5+
use resources::Asset;
6+
use std::str::FromStr;
77
use uri::{self, TryFromUri, UriWrap};
88

99
/// Represents the all assets end point for the stellar horizon server. The endpoint

client/src/endpoint/cursor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ macro_rules! impl_cursor {
3535
self.cursor.as_ref().map(|s| &**s)
3636
}
3737
}
38-
}
38+
};
3939
}
4040

4141
#[cfg(test)]

client/src/endpoint/effect.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//! Contains the endpoint for all effects.
2-
use error::Result;
3-
use std::str::FromStr;
4-
use resources::Effect;
52
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
3+
use error::Result;
64
use http::{Request, Uri};
5+
use resources::Effect;
6+
use std::str::FromStr;
77
use uri::{self, TryFromUri, UriWrap};
88

99
pub use super::account::Effects as ForAccount;
1010
pub use super::ledger::Effects as ForLedger;
11-
pub use super::transaction::Effects as ForTransaction;
1211
pub use super::operation::Effects as ForOperation;
12+
pub use super::transaction::Effects as ForTransaction;
1313

1414
/// This endpoint represents all effects that have resulted from successful opreations in Stellar.
1515
/// The endpoint will return all effects and accepts query params for a cursor, order, and limit.

client/src/endpoint/ledger.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Contains the endpoint for all ledgers.
2+
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
23
use error::Result;
34
use http::{Request, Uri};
4-
use std::str::FromStr;
55
use resources::{Effect, Ledger, Operation, Transaction};
6-
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
6+
use std::str::FromStr;
77
use uri::{self, TryFromUri, UriWrap};
88

99
/// Represents the all ledgers end point for the stellar horizon server. The endpoint

client/src/endpoint/limit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ macro_rules! impl_limit {
2727
self.limit
2828
}
2929
}
30-
}
30+
};
3131
}
3232

3333
#[cfg(test)]

client/src/endpoint/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
//! let all_txns = client.request(txns).unwrap();
1919
//! ```
2020
use error::Result;
21-
use serde::de::DeserializeOwned;
2221
use http;
22+
use serde::de::DeserializeOwned;
2323

2424
#[macro_use]
2525
mod cursor;
@@ -42,8 +42,8 @@ pub mod transaction;
4242

4343
pub use self::cursor::Cursor;
4444
pub use self::limit::Limit;
45-
pub use self::records::Records;
4645
pub use self::order::{Direction, Order, ParseDirectionError};
46+
pub use self::records::Records;
4747

4848
/// Represents the body of a request to an IntoRequest.
4949
#[derive(Debug)]

client/src/endpoint/operation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Contains the endpoint for all operations.
2+
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
23
use error::Result;
34
use http::{Request, Uri};
4-
use std::str::FromStr;
55
use resources::{Effect, Operation};
6-
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
6+
use std::str::FromStr;
77
use uri::{self, TryFromUri, UriWrap};
88

99
pub use super::account::Operations as ForAccount;

client/src/endpoint/order.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ macro_rules! impl_order {
3333
self.order
3434
}
3535
}
36-
}
36+
};
3737
}
3838

3939
/// The order to return results in.

client/src/endpoint/orderbook.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Contains the endpoint for fetching the orderbook for a given asset pair
2-
use error::Result;
3-
use std::str::FromStr;
4-
use resources::{AssetIdentifier, Orderbook};
52
use super::{Body, IntoRequest, Limit};
3+
use error::Result;
64
use http::{Request, Uri};
5+
use resources::{AssetIdentifier, Orderbook};
6+
use std::str::FromStr;
77

88
/// Given an asset pair, the endpoint will return all bids and asks with an optional
99
/// limit parameter to cap the number of records returned.

client/src/endpoint/payment.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! Contains the endpoint for all payment operations.
2+
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
23
use error::Result;
34
use http::{Request, Uri};
4-
use std::str::FromStr;
55
use resources::{Amount, AssetIdentifier, Operation, PaymentPath};
6-
use super::{Body, Cursor, Direction, IntoRequest, Limit, Order, Records};
6+
use std::str::FromStr;
77
use uri::{self, TryFromUri, UriWrap};
88

9-
pub use super::transaction::Payments as ForTransaction;
10-
pub use super::ledger::Payments as ForLedger;
119
pub use super::account::Payments as ForAccount;
10+
pub use super::ledger::Payments as ForLedger;
11+
pub use super::transaction::Payments as ForTransaction;
1212

1313
/// This endpoint represents all payment operations that are part of validated transactions.
1414
/// The endpoint will return all payments and accepts query params for a cursor, order, and limit.

0 commit comments

Comments
 (0)