Merge pull request #31 from dvdsk/file-size

Adds file size to pasta with an attachment
This commit is contained in:
Dániel Szabó 2022-07-25 13:39:00 +01:00 committed by GitHub
commit 9053211904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 23 deletions

View file

@ -2,15 +2,21 @@ use std::fmt;
use chrono::{Datelike, Timelike, Local, TimeZone};
use serde::{Deserialize, Serialize};
use bytesize::ByteSize;
use crate::util::animalnumbers::to_animal_names;
use crate::util::syntaxhighlighter::html_highlight;
#[derive(Serialize, Deserialize, PartialEq, Eq)]
pub struct PastaFile {
pub name: String, pub size: ByteSize ,
}
#[derive(Serialize, Deserialize)]
pub struct Pasta {
pub id: u64,
pub content: String,
pub file: String,
pub file: Option<PastaFile>,
pub extension: String,
pub private: bool,
pub editable: bool,