Skip to content

Commit

Permalink
feat: remove unused FileIds, dont derive Clone for DownloadedFile
Browse files Browse the repository at this point in the history
  • Loading branch information
yusdacra committed Feb 5, 2022
1 parent ceeeef8 commit 59b2134
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
17 changes: 2 additions & 15 deletions crates/sdk/src/api/rest.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use std::{convert::TryInto, error::Error as StdError, str::FromStr};

use super::Hmc;
use derive_more::{Display, From, Into, IntoIterator};
use derive_new::new;
use derive_more::Display;
use http::{HeaderValue, Uri};
use serde::{Deserialize, Serialize};

/// Kind of the file downloaded.
/// Kind of a file.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum FileKind {
/// An attachment file.
Expand Down Expand Up @@ -120,18 +119,6 @@ impl FromStr for FileId {
}
}

/// Wrapper type for `Vec<FileId>` so we can implement some traits.
///
/// You don't need to create this manually, since it implements `From<Vec<FileId>>`.
#[derive(new, Debug, Default, Clone, Into, From, IntoIterator)]
pub struct FileIds(Vec<FileId>);

impl From<FileIds> for Vec<String> {
fn from(o: FileIds) -> Vec<String> {
o.into_iter().map(|id| id.to_string()).collect()
}
}

/// Extracts file information from a header map.
///
/// Will not fail on missing `Content-Disposition` and instead fallback to
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk/src/client/rest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl Client {
}

/// A downloaded file.
#[derive(Debug, Clone)]
#[derive(Debug)]
#[non_exhaustive]
pub struct DownloadedFile {
/// Data of the downloaded file.
Expand Down

0 comments on commit 59b2134

Please sign in to comment.