diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a1ec53..71e1b7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,11 +3,20 @@ name: Main on: push: + paths-ignore: + - '*.md' branches: - master tags: - '**' pull_request: + paths-ignore: + - '*.md' + branches: + - master + +#env: +# CARGO_TERM_COLOR: always jobs: codestyle: diff --git a/dynomite/examples/demo.rs b/dynomite/examples/demo.rs index cf513b6..f79a5f2 100644 --- a/dynomite/examples/demo.rs +++ b/dynomite/examples/demo.rs @@ -8,10 +8,7 @@ use dynomite::{ Attributes, DynamoDbExt, Item, Retries, }; use futures::{future, TryStreamExt}; -#[cfg(feature = "default")] -use rusoto_core_default::Region; -#[cfg(feature = "rustls")] -use rusoto_core_rustls::Region; +use rusoto_core::Region; use std::{convert::TryFrom, error::Error}; use uuid::Uuid; diff --git a/dynomite/examples/local.rs b/dynomite/examples/local.rs index ca5f5f8..0cb709f 100644 --- a/dynomite/examples/local.rs +++ b/dynomite/examples/local.rs @@ -14,10 +14,7 @@ use dynomite::{ DynamoDbExt, Item, Retries, }; use futures::{future, TryStreamExt}; -#[cfg(feature = "default")] -use rusoto_core_default::Region; -#[cfg(feature = "rustls")] -use rusoto_core_rustls::Region; +use rusoto_core::Region; use std::{convert::TryFrom, error::Error}; use uuid::Uuid; diff --git a/dynomite/src/lib.rs b/dynomite/src/lib.rs index 4bddfa1..2ee2387 100644 --- a/dynomite/src/lib.rs +++ b/dynomite/src/lib.rs @@ -541,13 +541,13 @@ pub trait Item: IntoAttributes + FromAttributes { /// ``` pub trait Attribute: Sized { /// Returns a conversion into an `AttributeValue` - fn into_attr(self: Self) -> AttributeValue; + fn into_attr(self) -> AttributeValue; /// Returns a fallible conversion from an `AttributeValue` fn from_attr(value: AttributeValue) -> Result; } impl Attribute for AttributeValue { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { self } fn from_attr(value: AttributeValue) -> Result { @@ -635,7 +635,7 @@ impl IntoAttributes for BTreeMap { /// A Map type for all hash-map-like values, represented as the `M` AttributeValue type impl Attribute for T { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { let mut map = HashMap::new(); self.into_attrs(&mut map); AttributeValue { @@ -651,7 +651,7 @@ impl Attribute for T { /// A `String` type for `Uuids`, represented by the `S` AttributeValue type #[cfg(feature = "uuid")] impl Attribute for Uuid { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { s: Some(self.to_hyphenated().to_string()), ..AttributeValue::default() @@ -668,7 +668,7 @@ impl Attribute for Uuid { /// An `rfc3339` formatted version of `DateTime`, represented by the `S` AttributeValue type #[cfg(feature = "chrono")] impl Attribute for DateTime { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { s: Some(self.to_rfc3339()), ..Default::default() @@ -690,7 +690,7 @@ impl Attribute for DateTime { /// An `rfc3339` formatted version of `DateTime`, represented by the `S` AttributeValue type #[cfg(feature = "chrono")] impl Attribute for DateTime { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { s: Some(self.to_rfc3339()), ..Default::default() @@ -712,7 +712,7 @@ impl Attribute for DateTime { /// An `rfc3339` formatted version of `DateTime`, represented by the `S` AttributeValue type #[cfg(feature = "chrono")] impl Attribute for DateTime { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { s: Some(self.to_rfc3339()), ..Default::default() @@ -732,7 +732,7 @@ impl Attribute for DateTime { /// An `rfc3339` formatted version of `SystemTime`, represented by the `S` AttributeValue type #[cfg(feature = "chrono")] impl Attribute for SystemTime { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { let dt: DateTime = self.into(); dt.into_attr() } @@ -749,7 +749,7 @@ impl Attribute for SystemTime { /// A `String` type, represented by the S AttributeValue type impl Attribute for String { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { s: Some(self), ..AttributeValue::default() @@ -761,7 +761,7 @@ impl Attribute for String { } impl<'a> Attribute for Cow<'a, str> { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { s: Some(match self { Cow::Owned(o) => o, @@ -778,7 +778,7 @@ impl<'a> Attribute for Cow<'a, str> { /// A String Set type, represented by the SS AttributeValue type #[allow(clippy::implicit_hasher)] impl Attribute for HashSet { - fn into_attr(mut self: Self) -> AttributeValue { + fn into_attr(mut self) -> AttributeValue { AttributeValue { ss: Some(self.drain().collect()), ..AttributeValue::default() @@ -793,7 +793,7 @@ impl Attribute for HashSet { } impl Attribute for BTreeSet { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { ss: Some(self.into_iter().collect()), ..AttributeValue::default() @@ -810,7 +810,7 @@ impl Attribute for BTreeSet { /// A Binary Set type, represented by the BS AttributeValue type #[allow(clippy::implicit_hasher)] impl Attribute for HashSet> { - fn into_attr(mut self: Self) -> AttributeValue { + fn into_attr(mut self) -> AttributeValue { AttributeValue { bs: Some(self.drain().map(Bytes::from).collect()), ..AttributeValue::default() @@ -826,7 +826,7 @@ impl Attribute for HashSet> { // a Boolean type, represented by the BOOL AttributeValue type impl Attribute for bool { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { bool: Some(self), ..AttributeValue::default() @@ -839,7 +839,7 @@ impl Attribute for bool { // a Binary type, represented by the B AttributeValue type impl Attribute for bytes::Bytes { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { b: Some(self), ..AttributeValue::default() @@ -852,7 +852,7 @@ impl Attribute for bytes::Bytes { // a Binary type, represented by the B AttributeValue type impl Attribute for Vec { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { AttributeValue { b: Some(self.into()), ..AttributeValue::default() @@ -875,7 +875,7 @@ impl Attribute for Vec { /// and implement `Attribute` for `YourType`. An `Vec` implementation /// will already be provided impl Attribute for Vec { - fn into_attr(mut self: Self) -> AttributeValue { + fn into_attr(mut self) -> AttributeValue { AttributeValue { l: Some(self.drain(..).map(|s| s.into_attr()).collect()), ..AttributeValue::default() @@ -892,7 +892,7 @@ impl Attribute for Vec { } impl Attribute for Option { - fn into_attr(self: Self) -> AttributeValue { + fn into_attr(self) -> AttributeValue { match self { Some(value) => value.into_attr(), _ => AttributeValue {