Skip to content

Commit

Permalink
chore: Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Striegel authored and emschwartz committed Aug 19, 2019
1 parent 0c9716e commit 27d7c60
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions crates/interledger-packet/src/address.rs
Expand Up @@ -202,15 +202,15 @@ mod test_address {

use super::*;

static VALID_ADDRESSES: &'static [&'static [u8]] = &[
static VALID_ADDRESSES: &[&[u8]] = &[
b"test.alice.XYZ.1234.-_~",
b"g.us-fed.ach.0.acmebank.swx0a0.acmecorp.sales.199.~ipr.cdfa5e16-e759-4ba3-88f6-8b9dc83c1868.2",

b"g.A", b"private.A", b"example.A", b"peer.A", b"self.A",
b"test.A", b"test1.A", b"test2.A", b"test3.A", b"local.A",
];

static INVALID_ADDRESSES: &'static [&'static [u8]] = &[
static INVALID_ADDRESSES: &[&[u8]] = &[
b"", // empty
// Invalid characters.
b"test.alice 123",
Expand Down
6 changes: 3 additions & 3 deletions crates/interledger-packet/src/fixtures.rs
Expand Up @@ -25,7 +25,7 @@ lazy_static! {
.into();
}

pub static PREPARE_BYTES: &'static [u8] = b"\
pub static PREPARE_BYTES: &[u8] = b"\
\x0c\x82\x01\x4b\x00\x00\x00\x00\x00\x00\x00\x6b\x32\x30\x31\x38\x30\x36\
\x30\x37\x32\x30\x34\x38\x34\x32\x34\x38\x33\x11\x7b\x43\x4f\x1a\x54\xe9\
\x04\x4f\x4f\x54\x92\x3b\x2c\xff\x9e\x4a\x6d\x42\x0a\xe2\x81\xd5\x02\x5d\
Expand Down Expand Up @@ -60,7 +60,7 @@ lazy_static! {
};
}

pub static FULFILL_BYTES: &'static [u8] = b"\
pub static FULFILL_BYTES: &[u8] = b"\
\x0d\x82\x01\x24\x11\x7b\x43\x4f\x1a\x54\xe9\x04\x4f\x4f\x54\x92\x3b\x2c\
\xff\x9e\x4a\x6d\x42\x0a\xe2\x81\xd5\x02\x5d\x7b\xb0\x40\xc4\xb4\xc0\x4a\
\x82\x01\x01\x6c\x99\xf6\xa9\x69\x47\x30\x28\xef\x46\xe0\x9b\x47\x15\x81\
Expand Down Expand Up @@ -96,7 +96,7 @@ lazy_static! {
};
}

pub static REJECT_BYTES: &'static [u8] = b"\
pub static REJECT_BYTES: &[u8] = b"\
\x0e\x82\x01\x24\x46\x39\x39\x11\x65\x78\x61\x6d\x70\x6c\x65\x2e\x63\x6f\
\x6e\x6e\x65\x63\x74\x6f\x72\x0a\x53\x6f\x6d\x65\x20\x65\x72\x72\x6f\x72\
\x82\x01\x01\x6c\x99\xf6\xa9\x69\x47\x30\x28\xef\x46\xe0\x9b\x47\x15\x81\
Expand Down
8 changes: 4 additions & 4 deletions crates/interledger-packet/src/oer.rs
Expand Up @@ -421,9 +421,9 @@ mod buf_mut_oer_ext {

#[cfg(test)]
mod fixtures {
pub static ZERO_LENGTH_VARSTR: &'static [u8] = &[0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
pub static ONE_BYTE_VARSTR: &'static [u8] = &[0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
pub static TWO_BYTE_VARSTR: &'static [u8] = &[0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
pub static ZERO_LENGTH_VARSTR: &[u8] = &[0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
pub static ONE_BYTE_VARSTR: &[u8] = &[0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
pub static TWO_BYTE_VARSTR: &[u8] = &[0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
/// This buffer is an incorrectly-encoded VarString.
pub static LENGTH_TOO_HIGH_VARSTR: &'static [u8] = &[0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
pub static LENGTH_TOO_HIGH_VARSTR: &[u8] = &[0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
}
4 changes: 2 additions & 2 deletions crates/interledger-settlement-engines/src/api.rs
Expand Up @@ -112,9 +112,9 @@ impl_web! {
if let Some(ret) = ret {
let resp = Response::builder().status(ret.0).body(String::from_utf8_lossy(&ret.1).to_string()).unwrap();
if ret.0.is_success() {
return Either::A(Either::A(ok(resp)))
Either::A(Either::A(ok(resp)))
} else {
return Either::A(Either::B(err(resp)))
Either::A(Either::B(err(resp)))
}
} else {
Either::B(
Expand Down
Expand Up @@ -75,7 +75,7 @@ impl LeftoversStore for TestStore {
&self,
account_id: String,
uncredited_settlement_amount: Self::AssetType,
) -> Box<Future<Item = (), Error = ()> + Send> {
) -> Box<dyn Future<Item = (), Error = ()> + Send> {
let mut guard = self.uncredited_settlement_amount.write();
(*guard).insert(account_id, uncredited_settlement_amount);
Box::new(ok(()))
Expand All @@ -84,7 +84,7 @@ impl LeftoversStore for TestStore {
fn load_uncredited_settlement_amount(
&self,
account_id: String,
) -> Box<Future<Item = Self::AssetType, Error = ()> + Send> {
) -> Box<dyn Future<Item = Self::AssetType, Error = ()> + Send> {
let mut guard = self.uncredited_settlement_amount.write();
if let Some(l) = guard.get(&account_id) {
let l = l.clone();
Expand All @@ -102,7 +102,7 @@ impl EthereumStore for TestStore {
fn save_account_addresses(
&self,
data: HashMap<u64, Addresses>,
) -> Box<Future<Item = (), Error = ()> + Send> {
) -> Box<dyn Future<Item = (), Error = ()> + Send> {
let mut guard = self.addresses.write();
let mut guard2 = self.address_to_id.write();
for (acc, d) in data {
Expand Down
4 changes: 2 additions & 2 deletions crates/interledger-settlement/src/api.rs
Expand Up @@ -95,10 +95,10 @@ impl_web! {
if let Some(ret) = ret {
if ret.0.is_success() {
let resp = Response::builder().status(ret.0).body(ret.1).unwrap();
return Either::A(Either::A(ok(resp)))
Either::A(Either::A(ok(resp)))
} else {
let resp = Response::builder().status(ret.0).body(String::from_utf8_lossy(&ret.1).to_string()).unwrap();
return Either::A(Either::B(err(resp)))
Either::A(Either::B(err(resp)))

}
} else {
Expand Down
6 changes: 3 additions & 3 deletions crates/interledger-settlement/src/test_helpers.rs
Expand Up @@ -78,7 +78,7 @@ impl SettlementStore for TestStore {
_account_id: <Self::Account as Account>::AccountId,
_amount: u64,
_idempotency_key: Option<String>,
) -> Box<Future<Item = (), Error = ()> + Send> {
) -> Box<dyn Future<Item = (), Error = ()> + Send> {
let ret = if self.should_fail { err(()) } else { ok(()) };
Box::new(ret)
}
Expand All @@ -87,7 +87,7 @@ impl SettlementStore for TestStore {
&self,
_account_id: <Self::Account as Account>::AccountId,
_settle_amount: u64,
) -> Box<Future<Item = (), Error = ()> + Send> {
) -> Box<dyn Future<Item = (), Error = ()> + Send> {
let ret = if self.should_fail { err(()) } else { ok(()) };
Box::new(ret)
}
Expand Down Expand Up @@ -127,7 +127,7 @@ impl AccountStore for TestStore {
fn get_accounts(
&self,
account_ids: Vec<<<Self as AccountStore>::Account as Account>::AccountId>,
) -> Box<Future<Item = Vec<Self::Account>, Error = ()> + Send> {
) -> Box<dyn Future<Item = Vec<Self::Account>, Error = ()> + Send> {
let accounts: Vec<TestAccount> = self
.accounts
.iter()
Expand Down

0 comments on commit 27d7c60

Please sign in to comment.