Private
Public Access
1
0

cargo fmt

This commit is contained in:
2025-06-06 16:39:31 -07:00
parent 8cd72d9417
commit 1d3b2f25ba
44 changed files with 758 additions and 505 deletions

View File

@@ -20,14 +20,20 @@ pub struct Attachment {
impl Attachment {
pub fn get_path(&self, preview: bool) -> PathBuf {
self.base_path.with_extension(if preview { "preview" } else { "full" })
self.base_path
.with_extension(if preview { "preview" } else { "full" })
}
pub fn is_downloaded(&self, preview: bool) -> bool {
std::fs::exists(&self.get_path(preview))
.expect(format!("Wasn't able to check for the existence of an attachment file path at {}", &self.get_path(preview).display()).as_str())
std::fs::exists(&self.get_path(preview)).expect(
format!(
"Wasn't able to check for the existence of an attachment file path at {}",
&self.get_path(preview).display()
)
.as_str(),
)
}
}
}
impl From<kordophone::model::message::AttachmentMetadata> for AttachmentMetadata {
fn from(metadata: kordophone::model::message::AttachmentMetadata) -> Self {
@@ -61,4 +67,4 @@ impl From<AttributionInfo> for kordophone::model::message::AttributionInfo {
height: info.height,
}
}
}
}