From 7e9cc00d7c78bd5b297113f6a338aac00e9988a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:44:24 +0000 Subject: [PATCH] derive Ord for FileChecked --- src/cli.rs | 2 +- src/sharry/file/checked.rs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index fd5da89..6e96e3b 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -76,7 +76,7 @@ impl Cli { pub fn get_hash(&self) -> String { let file_refs = { - let mut refs: Vec<_> = self.files.iter().map(FileChecked::get_path).collect(); + let mut refs: Vec<_> = self.files.iter().collect(); refs.sort_unstable(); refs diff --git a/src/sharry/file/checked.rs b/src/sharry/file/checked.rs index d94c2a4..87e6054 100644 --- a/src/sharry/file/checked.rs +++ b/src/sharry/file/checked.rs @@ -11,7 +11,7 @@ use ureq::http::StatusCode; use super::{Alias, FileUploading, Share, SharryAlias}; -#[derive(Serialize, Deserialize, Debug, Clone, Hash)] +#[derive(Debug, Clone, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] pub struct FileChecked { path: PathBuf, } @@ -31,10 +31,6 @@ impl FileChecked { } } - pub fn get_path(&self) -> &Path { - &self.path - } - pub fn start_upload( self, http: &ureq::Agent,