diff options
| author | acdenisSK <[email protected]> | 2017-10-03 16:55:58 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-10-03 16:55:58 +0200 |
| commit | 2233337d334e52b5c4cf7149097e70ef5c5433b3 (patch) | |
| tree | ba14ca714fa7bc1e6ba1d26f10e7c170bdf10ffa /src/http | |
| parent | Use the de-generification trick. (diff) | |
| download | serenity-2233337d334e52b5c4cf7149097e70ef5c5433b3.tar.xz serenity-2233337d334e52b5c4cf7149097e70ef5c5433b3.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)?; |