Skip to content

Commit a0fd956

Browse files
authored
Issue #18 .await syntax (#144)
* update toolchain to nightly and fix `cargo clippy` installation error * fix clippy errors * update to `.await` and fix cargo errors/warnings * clean up some files * Clean up some files and some not needed dependencies * update .travis.yml to use latest nightly * follower - merge fix for `.await` * fix cargo fmt * cargo-make 0.22.2 fixes the installation of clippy so remove the custom task override * update `futures-preview` to `alpha.19` * adapter - fix `clippy` warning * enable build failure on a `clippy` warning
1 parent 6652af3 commit a0fd956

File tree

28 files changed

+101
-479
lines changed

28 files changed

+101
-479
lines changed

.env.dist

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: rust
22
rust:
3-
- nightly-2019-05-08
3+
- nightly
44
cache: cargo
55
env:
66
global:

Cargo.lock

Lines changed: 31 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
members = [
44
"adapter",
55
"primitives",
6-
"validator_worker",
7-
# "sentry",
8-
"adview-manager",
6+
"validator_worker",
7+
# "sentry",
8+
"adview-manager",
99
]

Makefile.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[env]
22
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"
3-
CARGO_MAKE_CLIPPY_ARGS = "--all-features"
3+
CARGO_MAKE_CLIPPY_ARGS = "--all-features -- -D warnings"
44

55
[tasks.dev-test-flow]
66
dependencies = [

adapter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2018"
77
[dependencies]
88
primitives = {path = "../primitives"}
99
# Futures
10-
futures-preview = {version = "=0.3.0-alpha.16"}
10+
futures-preview = {version = "=0.3.0-alpha.19"}
1111
# Time handling
1212
chrono = "0.4"
1313
time = "0.1.42"

adapter/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#![deny(rust_2018_idioms)]
2+
#![deny(clippy::all)]
3+
#![deny(clippy::match_bool)]
4+
15
use std::error::Error;
26

37
use chrono::{DateTime, Utc};
@@ -119,7 +123,7 @@ impl EthereumChannel {
119123
));
120124
}
121125

122-
if let Err(_) = BigNum::try_from(token_amount) {
126+
if BigNum::try_from(token_amount).is_err() {
123127
return Err(ChannelError::InvalidArgument("invalid token amount".into()));
124128
}
125129

adview-manager/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub struct AdViewManagerOptions {
4444
impl AdViewManagerOptions {
4545
pub fn size(&self) -> Option<(u64, u64)> {
4646
self.width
47-
.and_then(|width| self.height.and_then(|height| Some((width, height))))
47+
.and_then(|width| self.height.map(|height| (width, height)))
4848
}
4949
}
5050

primitives/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ version = "0.1.0"
44
authors = ["Lachezar Lechev <[email protected]>, Omidiora Samuel <[email protected]>"]
55
edition = "2018"
66

7-
[features]
8-
9-
107
[dependencies]
118
# Futures
12-
futures-preview = { version = "=0.3.0-alpha.16", features = ["compat", "io-compat"]}
9+
futures-preview = { version = "=0.3.0-alpha.19", features = ["compat"]}
1310
# (De)Serialization
1411
serde = { version = "^1.0", features = ['derive'] }
1512
serde_json = "1.0"

primitives/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@ pub mod targeting_tag;
1818
pub mod util;
1919
pub mod validator;
2020

21-
//#[cfg(any(test, feature = "fixtures"))]
22-
//pub use util::tests as test_util;
23-
//
24-
//pub use self::asset::Asset;
2521
pub use self::ad_unit::AdUnit;
2622
pub use self::balances_map::BalancesMap;
2723
pub use self::big_num::BigNum;
2824
pub use self::channel::{Channel, ChannelSpec, SpecValidator, SpecValidators};
2925
pub use self::config::Config;
3026
pub use self::event_submission::EventSubmission;
31-
pub use self::validator::ValidatorDesc;
32-
//#[cfg(feature = "repositories")]
33-
//pub use self::repository::*;
3427
pub use self::targeting_tag::TargetingTag;
28+
pub use self::validator::ValidatorDesc;
3529

3630
#[derive(Debug, PartialEq, Eq)]
3731
pub enum DomainError {

0 commit comments

Comments
 (0)