Skip to content

Commit

Permalink
Derive Serialize and Deserialize for Region and Credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
fmckeogh committed Jun 23, 2022
1 parent 32a5a69 commit f2299a1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions aws-creds/Cargo.toml
Expand Up @@ -21,9 +21,7 @@ rust-ini = "0.18"
attohttpc = { version = "0.19", default-features = false, features = ["json"], optional = true }
url = "2"
serde-xml-rs = "0.5"
serde = "1"
serde_derive = "1"

serde = { version = "1.0.137", features = ["derive"] }

[features]
default = ["native-tls"]
Expand Down
3 changes: 2 additions & 1 deletion aws-creds/src/credentials.rs
@@ -1,6 +1,7 @@
#![allow(dead_code)]
use crate::error::CredentialsError;
use ini::Ini;
use serde::{Deserialize, Serialize};
use serde_xml_rs as serde_xml;
use std::collections::HashMap;
use std::env;
Expand Down Expand Up @@ -61,7 +62,7 @@ use url::Url;
/// #[cfg(feature="http-credentials")]
/// let credentials = Credentials::new(None, None, None, None, None);
/// ```
#[derive(Clone, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct Credentials {
/// AWS public access key.
pub access_key: Option<String>,
Expand Down
3 changes: 0 additions & 3 deletions aws-creds/src/lib.rs
@@ -1,9 +1,6 @@
#![allow(unused_imports)]
#![forbid(unsafe_code)]

#[macro_use]
extern crate serde_derive;

mod credentials;
pub use credentials::*;
pub mod error;
1 change: 1 addition & 0 deletions aws-region/Cargo.toml
Expand Up @@ -16,3 +16,4 @@ path = "src/lib.rs"

[dependencies]
thiserror = "1"
serde = { version = "1.0.137", features = ["derive"], optional = true }
1 change: 1 addition & 0 deletions aws-region/src/region.rs
Expand Up @@ -25,6 +25,7 @@ use std::str::{self, FromStr};
///
/// ```
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Region {
/// us-east-1
UsEast1,
Expand Down

0 comments on commit f2299a1

Please sign in to comment.