Skip to content

Commit

Permalink
feat: add Clone on structs
Browse files Browse the repository at this point in the history
  • Loading branch information
DevYukine committed Nov 23, 2023
1 parent b5082a2 commit 79dd41e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions rustfoil-lib/src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use async_recursion::async_recursion;
use std::path::PathBuf;
use tokio::fs;

#[derive(Debug, Clone)]
pub struct LocalFile {
pub path: PathBuf,
pub size: u64,
Expand Down
8 changes: 4 additions & 4 deletions rustfoil-lib/src/gdrive/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ pub struct GoogleDriveFileInfo {
pub shared: bool,
}

#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct GoogleDriveFolderInfo {
pub id: String,
pub shared: bool,
}

#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct GoogleDriveScanResult {
pub files: Vec<GoogleDriveFileInfo>,
pub folders: Vec<GoogleDriveFolderInfo>,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GoogleDriveTokenInfo {
pub token: GoogleDriveToken,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GoogleDriveToken {
pub access_token: String,
pub refresh_token: String,
Expand Down
1 change: 1 addition & 0 deletions rustfoil-lib/src/http/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::abstraction::file::TinfoilFileLike;
use crate::fs::file::LocalFile;
use std::path::PathBuf;

#[derive(Debug, Clone)]
pub struct HttpFile {
pub url: String,
pub size: i64,
Expand Down
8 changes: 4 additions & 4 deletions rustfoil-lib/src/tinfoil/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;

#[skip_serializing_none]
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TinfoilIndex {
pub files: Option<Vec<TinfoilFile>>,
Expand All @@ -21,20 +21,20 @@ pub struct TinfoilIndex {
pub locations: Option<Vec<TinfoilLocation>>,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TinfoilFile {
pub url: String,
pub size: i64,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TinfoilLocation {
pub url: String,
pub title: String,
pub action: String,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TinfoilToken {
pub access_token: String,
pub refresh_token: String,
Expand Down

0 comments on commit 79dd41e

Please sign in to comment.