Skip to content

Commit

Permalink
chore: cargo lint
Browse files Browse the repository at this point in the history
Satisfies the latest cargo lints. I took the easy way out, preserving
the existing function sigs, rather than performing a deeper refactor.
Ignored the checks on the re-export of metrics code across components.

Also added `--all-targets` to the check command, to make sure we're
catching everything.

Revert "ci: disable -D warnings"
This reverts commit 4e7c77b.

Closes #3543.
  • Loading branch information
conorsch committed Jan 3, 2024
1 parent 8aba60e commit 21d6021
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 9 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ jobs:
uses: taiki-e/install-action@nextest
- name: Load rust cache
uses: astriaorg/[email protected]
- name: Run cargo check
run: cargo check --release
- name: Run cargo check, failing on warnings
run: cargo check --release --all-targets
env:
# The `-D warnings` option causes an error on warnings;
# but it caused apparently spurious warnings, so it was disabled.
# we must duplicate the rustflags from `.cargo/config.toml`.
RUSTFLAGS: "--cfg tokio_unstable"
RUSTFLAGS: "-D warnings --cfg tokio_unstable"

# If a dependency was modified, Cargo.lock may flap if not committed.
- name: Check for diffs
Expand Down
2 changes: 1 addition & 1 deletion crates/bin/pcli/src/command/ceremony.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use penumbra_proto::{
view::v1alpha1::GasPricesRequest,
};
use penumbra_transaction::memo::MemoPlaintext;
use penumbra_view::{Planner, ViewClient};
use penumbra_view::Planner;

use crate::App;

Expand Down
2 changes: 1 addition & 1 deletion crates/bin/pcli/src/command/view/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl BalanceCmd {
false
}

pub async fn exec<V: ViewClient>(&self, fvk: &FullViewingKey, view: &mut V) -> Result<()> {
pub async fn exec<V: ViewClient>(&self, _fvk: &FullViewingKey, view: &mut V) -> Result<()> {
let asset_cache = view.assets().await?;

// Initialize the table
Expand Down
2 changes: 1 addition & 1 deletion crates/bin/pcli/src/command/view/staked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl StakedCmd {

pub async fn exec(
&self,
full_viewing_key: &FullViewingKey,
_full_viewing_key: &FullViewingKey,
view_client: &mut impl ViewClient,
pd_channel: Channel,
) -> Result<()> {
Expand Down
1 change: 1 addition & 0 deletions crates/core/component/governance/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! This trick is probably good to avoid in general, because it could be
//! confusing, but in this limited case, it seems like a clean option.
#[allow(unused_imports)]
pub use metrics::*;

/// Registers all metrics used by this crate.
Expand Down
1 change: 1 addition & 0 deletions crates/core/component/ibc/src/component/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! This trick is probably good to avoid in general, because it could be
//! confusing, but in this limited case, it seems like a clean option.
#[allow(unused_imports)]
pub use metrics::*;

/// Registers all metrics used by this crate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! This trick is probably good to avoid in general, because it could be
//! confusing, but in this limited case, it seems like a clean option.
#[allow(unused_imports)]
pub use metrics::*;

/// Registers all metrics used by this crate.
Expand Down
2 changes: 1 addition & 1 deletion crates/crypto/decaf377-frost/src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_ff::{Field as _, One, UniformRand, Zero};
use decaf377::{Element, FieldExt, Fr};
pub use frost_core::{frost, Ciphersuite, Field, FieldError, Group, GroupError};
pub use frost_core::{Ciphersuite, Field, FieldError, Group, GroupError};
use rand_core;

use crate::hash::Hasher;
Expand Down
2 changes: 1 addition & 1 deletion crates/crypto/tct/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub mod frontier {
item::Item,
leaf::Leaf,
node::Node,
tier::{Nested, Tier},
tier::Tier,
top::{Top, TrackForgotten},
};
}
Expand Down
1 change: 1 addition & 0 deletions crates/view/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! This trick is probably good to avoid in general, because it could be
//! confusing, but in this limited case, it seems like a clean option.
#[allow(unused_imports)]
pub use metrics::*;

/// Registers all metrics used by this crate.
Expand Down

0 comments on commit 21d6021

Please sign in to comment.