From 74621c9c372af3d0417c8a0b701d84686faa36ec Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 26 Aug 2021 09:05:39 +0800 Subject: [PATCH] Explicitly specify `Send` requirement where dyn traits are used (#296) --- src/mako/api/lib/mbuild.mako | 4 ++-- src/rust/api/client.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mako/api/lib/mbuild.mako b/src/mako/api/lib/mbuild.mako index c3a9a75bf7..cd35cb2fc9 100644 --- a/src/mako/api/lib/mbuild.mako +++ b/src/mako/api/lib/mbuild.mako @@ -738,9 +738,9 @@ else { mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); let mime_type = mp_reader.mime_type(); - (&mut mp_reader as &mut dyn io::Read, (CONTENT_TYPE, mime_type.to_string())) + (&mut mp_reader as &mut (dyn io::Read + Send), (CONTENT_TYPE, mime_type.to_string())) }, - _ => (&mut request_value_reader as &mut dyn io::Read, (CONTENT_TYPE, json_mime_type.to_string())), + _ => (&mut request_value_reader as &mut (dyn io::Read + Send), (CONTENT_TYPE, json_mime_type.to_string())), }; % endif let client = &self.hub.client; diff --git a/src/rust/api/client.rs b/src/rust/api/client.rs index c1ee5ffd81..a1c3e4f762 100644 --- a/src/rust/api/client.rs +++ b/src/rust/api/client.rs @@ -360,8 +360,8 @@ const BOUNDARY: &str = "MDuXWGyeE33QFXGchb2VFWc4Z7945d"; /// to google APIs, and might not be a fully-featured implementation. #[derive(Default)] pub struct MultiPartReader<'a> { - raw_parts: Vec<(HeaderMap, &'a mut dyn Read)>, - current_part: Option<(Cursor>, &'a mut dyn Read)>, + raw_parts: Vec<(HeaderMap, &'a mut (dyn Read + Send))>, + current_part: Option<(Cursor>, &'a mut (dyn Read + Send))>, last_part_boundary: Option>>, } @@ -384,7 +384,7 @@ impl<'a> MultiPartReader<'a> { /// `mime` - It will be put onto the content type pub fn add_part( &mut self, - reader: &'a mut dyn Read, + reader: &'a mut (dyn Read + Send), size: u64, mime_type: Mime, ) -> &mut MultiPartReader<'a> {