diff options
| author | acdenisSK <[email protected]> | 2017-10-03 16:55:58 +0200 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-09 15:47:48 -0700 |
| commit | 06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a (patch) | |
| tree | eee16dc9d1c35e2b17a0a59d55cc85fa82726587 /src/http | |
| parent | Use the de-generification trick. (diff) | |
| download | serenity-06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a.tar.xz serenity-06dc6937bd3d4e5912de08e4ac3630a1f83b7f5a.zip | |
Revert "Use the de-generification trick."
Makes the compiliation time just a bit worse
Diffstat (limited to 'src/http')
| -rw-r--r-- | src/http/mod.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/http/mod.rs b/src/http/mod.rs index f7a71ee..4f70dcf 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -1613,10 +1613,6 @@ pub fn remove_group_recipient(group_id: u64, user_id: u64) -> Result<()> { /// [`HttpError::InvalidRequest`]: enum.HttpError.html#variant.InvalidRequest pub fn send_files<'a, T>(channel_id: u64, files: Vec<T>, map: JsonMap) -> Result<Message> where T: Into<AttachmentType<'a>> { - _send_files(channel_id, files.into_iter().map(|a| a.into()).collect(), map) -} - -fn _send_files<'a>(channel_id: u64, files: Vec<AttachmentType<'a>>, map: JsonMap) -> Result<Message> { let uri = format!(api!("/channels/{}/messages"), channel_id); let url = match Url::parse(&uri) { Ok(url) => url, @@ -1637,7 +1633,7 @@ fn _send_files<'a>(channel_id: u64, files: Vec<AttachmentType<'a>>, map: JsonMap let mut file_num = "0".to_string(); for file in files { - match file { + match file.into() { AttachmentType::Bytes((mut bytes, filename)) => { request .write_stream(&file_num, &mut bytes, Some(filename), None)?; |