Skip to content

Commit

Permalink
Apply mkrasnitski/polarbits' suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
kangalio committed Oct 30, 2023
1 parent ab4f552 commit 3b5ecdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use secrecy::{ExposeSecret, SecretString};
use serde::de::DeserializeOwned;
use tracing::{debug, instrument, trace};

use super::multipart::Multipart;
use super::multipart::{Multipart, MultipartUpload};
use super::ratelimiting::Ratelimiter;
use super::request::Request;
use super::routing::Route;
Expand All @@ -26,7 +26,6 @@ use super::{
HttpError,
LightMethod,
MessagePagination,
MultipartUpload,
UserPagination,
};
use crate::builder::CreateAttachment;
Expand Down Expand Up @@ -490,7 +489,7 @@ impl Http {
request.body = Some(to_vec(map)?);
} else {
request.multipart = Some(Multipart {
upload: MultipartUpload::Attachments(files.into_iter().map(Into::into).collect()),
upload: MultipartUpload::Attachments(files),
payload_json: Some(to_string(map)?),
fields: vec![],
});
Expand Down Expand Up @@ -690,7 +689,7 @@ impl Http {
request.body = Some(to_vec(map)?);
} else {
request.multipart = Some(Multipart {
upload: MultipartUpload::Attachments(files.into_iter().map(Into::into).collect()),
upload: MultipartUpload::Attachments(files),
payload_json: Some(to_string(map)?),
fields: vec![],
});
Expand Down Expand Up @@ -1523,9 +1522,7 @@ impl Http {
request.body = Some(to_vec(map)?);
} else {
request.multipart = Some(Multipart {
upload: MultipartUpload::Attachments(
new_attachments.into_iter().map(Into::into).collect(),
),
upload: MultipartUpload::Attachments(new_attachments),
payload_json: Some(to_string(map)?),
fields: vec![],
});
Expand Down
2 changes: 1 addition & 1 deletion src/http/multipart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub enum MultipartUpload {
Attachments(Vec<CreateAttachment>),
}

/// Holder for multipart body. Contains files, multipart fields, and payload_json for creating
/// Holder for multipart body. Contains upload data, multipart fields, and payload_json for creating
/// requests with attachments.
#[derive(Clone, Debug)]
pub struct Multipart {
Expand Down

0 comments on commit 3b5ecdd

Please sign in to comment.