aboutsummaryrefslogtreecommitdiff
path: root/src/mailbox.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-19 14:33:49 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-19 14:33:49 +0200
commit6be90936a108d971e0cfa3ddaa9c2d54557e30f3 (patch)
treeed0dae1b4ebf3215b808b81d9980376e9b5dee26 /src/mailbox.rs
parent1ac56a91981bee4867dfb054bd2199c6111fe1eb (diff)
downloadaerogramme-6be90936a108d971e0cfa3ddaa9c2d54557e30f3.tar.gz
aerogramme-6be90936a108d971e0cfa3ddaa9c2d54557e30f3.zip
Some refactoring
Diffstat (limited to 'src/mailbox.rs')
-rw-r--r--src/mailbox.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mailbox.rs b/src/mailbox.rs
index d997691..44b9f95 100644
--- a/src/mailbox.rs
+++ b/src/mailbox.rs
@@ -22,19 +22,17 @@ pub struct Mailbox {
impl Mailbox {
pub async fn new(
- k2v_region: &Region,
- s3_region: &Region,
creds: &Credentials,
name: String,
) -> Result<Self> {
- let uid_index = Bayou::<UidIndex>::new(k2v_region, s3_region, creds, name.clone())?;
+ let uid_index = Bayou::<UidIndex>::new(creds, name.clone())?;
Ok(Self {
- bucket: creds.bucket.clone(),
+ bucket: creds.bucket().to_string(),
name,
- key: creds.master_key.clone(),
- k2v: creds.k2v_client(&k2v_region)?,
- s3: creds.s3_client(&s3_region)?,
+ key: creds.keys.master.clone(),
+ k2v: creds.k2v_client()?,
+ s3: creds.s3_client()?,
uid_index,
})
}