Skip to content

Commit

Permalink
refactor: fix warnings by clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-sakamoto committed Jun 21, 2023
1 parent c202b48 commit b0fad59
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use std::{
fs,
io::Error as IOError,
path,
str::FromStr,
};

use super::control;
Expand Down
4 changes: 2 additions & 2 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ pub fn typed_key_for_schema(
) -> Option<Key> {
// Fetch Partition Key ("HASH") or Sort Key ("RANGE") from given Key Schema. pk should always exists, but sk may not.
let target_key = ks
.into_iter()
.iter()
.find(|x| x.key_type.as_ref().map(|v| v.as_str()) == Some(pk_or_sk));
target_key.map(|key| Key {
name: key.clone().attribute_name.unwrap(),
// kind should be one of S/N/B, Which can be retrieved from AttributeDefinition's attribute_type.
kind: KeyType::from_str(
&attrs
attrs
.iter()
.find(|at| at.attribute_name == key.attribute_name)
.expect("primary key should be in AttributeDefinition.")
Expand Down
6 changes: 3 additions & 3 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ pub enum Mode {
OnDemand,
}

impl Into<BillingMode> for Mode {
fn into(self) -> BillingMode {
match self {
impl From<Mode> for BillingMode {
fn from(value: Mode) -> Self {
match value {
Mode::Provisioned => BillingMode::Provisioned,
Mode::OnDemand => BillingMode::PayPerRequest,
}
Expand Down

0 comments on commit b0fad59

Please sign in to comment.