Skip to content

Commit

Permalink
Set up CodeCov, fix formatting and clippy warnings on stable Rust (#19)
Browse files Browse the repository at this point in the history
* add codecov token

* fix tendermint dep

* add token to repo

* fix fmt

* Fix clippy warning

* Switch back CI to stable Rust

* Adapt rustfmt config for stable

Co-authored-by: Romain Ruetschi <[email protected]>
  • Loading branch information
ancazamfir and romac authored Mar 3, 2020
1 parent f6ecd3c commit 01dde40
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
Expand All @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
Expand Down
17 changes: 7 additions & 10 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
unstable_features = true

# comments
comment_width = 100
wrap_comments = true

# imports
max_width = 100
reorder_imports = true

# strings
format_strings = false
max_width = 100
# nightly only

# unstable_features = true
# format_strings = false
# comment_width = 100
# wrap_comments = true
2 changes: 1 addition & 1 deletion modules/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tendermint = { path = "../../tendermint-rs/tendermint" }
tendermint = { git = "https://github.com/interchainio/tendermint-rs.git" }
anomaly = "0.2.0"
thiserror = "1.0.11"
serde_derive = "1.0.104"
Expand Down
2 changes: 1 addition & 1 deletion modules/src/ics02_client/client_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub enum ClientType {

impl ClientType {
/// Yields the identifier of this client type as a string
pub fn as_string(&self) -> &'static str {
pub fn as_string(self) -> &'static str {
match self {
Self::Tendermint => "tendermint",
}
Expand Down
3 changes: 2 additions & 1 deletion modules/src/ics02_client/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use super::header::Header;
use super::state::ConsensusState;
use crate::ics24_host::client::ClientId;

// FIXME: Remove Header associated type and use Box<dyn tendermint::lite::Header> instead of Self::Header?
// FIXME: Remove Header associated type and use Box<dyn tendermint::lite::Header> instead of
// Self::Header?

pub trait Msg {
type ValidationError: std::error::Error;
Expand Down
3 changes: 2 additions & 1 deletion modules/src/ics24_host/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const PATH_SEPARATOR: char = '/';

/// Default validator function for identifiers.
///
/// A valid identifier only contain lowercase alphabetic characters, and be of a given min and max length.
/// A valid identifier only contain lowercase alphabetic characters, and be of a given min and max
/// length.
pub fn validate_identifier(id: &str, min: usize, max: usize) -> Result<(), ValidationError> {
assert!(max >= min);

Expand Down

0 comments on commit 01dde40

Please sign in to comment.