diff --git a/src/app.rs b/src/app.rs index 1d2cb002..b568b94b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -27,7 +27,6 @@ use std::{ fs, io::Error as IOError, path, - str::FromStr, }; use super::control; diff --git a/src/key.rs b/src/key.rs index 6da7e343..65896891 100644 --- a/src/key.rs +++ b/src/key.rs @@ -113,13 +113,13 @@ pub fn typed_key_for_schema( ) -> Option { // 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.") diff --git a/src/util.rs b/src/util.rs index 8f82663c..ddd9727c 100644 --- a/src/util.rs +++ b/src/util.rs @@ -58,9 +58,9 @@ pub enum Mode { OnDemand, } -impl Into for Mode { - fn into(self) -> BillingMode { - match self { +impl From for BillingMode { + fn from(value: Mode) -> Self { + match value { Mode::Provisioned => BillingMode::Provisioned, Mode::OnDemand => BillingMode::PayPerRequest, }