Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsharm committed Dec 20, 2024
1 parent dbde931 commit 90325a8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions tough/src/editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ impl RepositoryEditor {
})
};

let signed_snapshot = self.build_snapshot(&signed_targets, &signed_delegated_targets)?;
let signed_snapshot =
self.build_snapshot(&signed_targets, signed_delegated_targets.as_ref())?;
let signed_snapshot = SignedRole::new(signed_snapshot, &root, keys, &rng).await?;
let signed_timestamp = self.build_timestamp(&signed_snapshot)?;
let signed_timestamp = SignedRole::new(signed_timestamp, &root, keys, &rng).await?;
Expand Down Expand Up @@ -669,7 +670,7 @@ impl RepositoryEditor {
fn build_snapshot(
&self,
signed_targets: &SignedRole<Targets>,
signed_delegated_targets: &Option<SignedDelegatedTargets>,
signed_delegated_targets: Option<&SignedDelegatedTargets>,
) -> Result<Snapshot> {
let version = self.snapshot_version.context(error::MissingSnafu {
field: "snapshot version",
Expand All @@ -687,7 +688,7 @@ impl RepositoryEditor {
.meta
.insert("targets.json".to_owned(), targets_meta);

if let Some(signed_delegated_targets) = signed_delegated_targets.as_ref() {
if let Some(signed_delegated_targets) = signed_delegated_targets {
for delegated_targets in &signed_delegated_targets.roles {
let meta = Self::snapshot_meta(delegated_targets);
snapshot.meta.insert(
Expand Down
2 changes: 1 addition & 1 deletion tough/src/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub trait Sign: Sync + Send {

/// Implements `Sign` for a reference to any type that implements `Sign`.
#[async_trait]
impl<'a, T: Sign> Sign for &'a T {
impl<T: Sign> Sign for &T {
fn tuf_key(&self) -> Key {
(*self).tuf_key()
}
Expand Down
1 change: 0 additions & 1 deletion tough/tests/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use tough::IntoVec;
use url::Url;

/// Utilities for tests. Not every test module uses every function, so we suppress unused warnings.
pub const DATA_1: &str = "123\n456\n789\n0\n";
pub const DATA_2: &str = "abc\ndef\nhij\nk\n";
pub const DATA_3: &str = "!@#\n$%^\n&*(\n)\n";
Expand Down
1 change: 0 additions & 1 deletion tuftool/tests/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use tough::IntoVec;
use url::Url;

/// Utilities for tests. Not every test module uses every function, so we suppress unused warnings.
/// Returns the path to our test data directory
#[allow(unused)]
pub fn test_data() -> PathBuf {
Expand Down

0 comments on commit 90325a8

Please sign in to comment.