From f2003fbf78c3e08cec5e9319f512e0f103efbe66 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Fri, 26 Jun 2020 20:49:32 -0400 Subject: [PATCH] refactor: Use std::io to shorten lines --- delorean_object_store/src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/delorean_object_store/src/lib.rs b/delorean_object_store/src/lib.rs index 872fbc480b..4ae55db688 100644 --- a/delorean_object_store/src/lib.rs +++ b/delorean_object_store/src/lib.rs @@ -20,10 +20,9 @@ use rusoto_core::ByteStream; use rusoto_credential::ChainProvider; use rusoto_s3::S3; use snafu::{ensure, futures::TryStreamExt as _, OptionExt, ResultExt, Snafu}; +use std::{collections::BTreeMap, fmt, io}; use tokio::sync::RwLock; -use std::{collections::BTreeMap, fmt}; - /// Universal interface to multiple object store services. #[derive(Debug)] pub struct ObjectStore(ObjectStoreIntegration); @@ -47,7 +46,7 @@ impl ObjectStore { /// Save the provided bytes to the specified location. pub async fn put(&self, location: &str, bytes: S, length: usize) -> Result<()> where - S: Stream> + Send + Sync + 'static, + S: Stream> + Send + Sync + 'static, { use ObjectStoreIntegration::*; match &self.0 { @@ -120,7 +119,7 @@ impl GoogleCloudStorage { /// Save the provided bytes to the specified location. async fn put(&self, location: &str, bytes: S, length: usize) -> InternalResult<()> where - S: Stream> + Send + Sync + 'static, + S: Stream> + Send + Sync + 'static, { let temporary_non_streaming = bytes .map_ok(|b| bytes::BytesMut::from(&b[..])) @@ -242,7 +241,7 @@ impl AmazonS3 { /// Save the provided bytes to the specified location. async fn put(&self, location: &str, bytes: S, length: usize) -> InternalResult<()> where - S: Stream> + Send + Sync + 'static, + S: Stream> + Send + Sync + 'static, { let bytes = ByteStream::new_with_size(bytes, length); @@ -355,7 +354,7 @@ impl InMemory { /// Save the provided bytes to the specified location. async fn put(&self, location: &str, bytes: S, length: usize) -> InternalResult<()> where - S: Stream> + Send + Sync + 'static, + S: Stream> + Send + Sync + 'static, { let content = bytes .map_ok(|b| bytes::BytesMut::from(&b[..]))