just unwrap on datetime formatting, it should never be an issue and there's no point having an error ready to pass back to the client

This commit is contained in:
xenofem 2022-05-01 02:22:03 -04:00
parent b33bb7aa9d
commit 99b93b4e7d

View file

@ -22,8 +22,6 @@ enum Error {
Parse(#[from] serde_json::Error),
#[error("Error writing to stored file")]
Storage(#[from] std::io::Error),
#[error("Time formatting error")]
TimeFormat(#[from] time::error::Format),
#[error("Duplicate filename could not be deduplicated")]
DuplicateFilename,
#[error("This message type was not expected at this stage")]
@ -45,8 +43,7 @@ enum Error {
impl Error {
fn close_code(&self) -> CloseCode {
match self {
Self::Storage(_)
| Self::TimeFormat(_) => CloseCode::Error,
Self::Storage(_) => CloseCode::Error,
Self::Parse(_)
| Self::UnexpectedMessageType
| Self::ClosedEarly(_)
@ -245,7 +242,7 @@ impl Uploader {
let zip_writer = super::zip::ZipGenerator::new(files, writer);
let size = zip_writer.total_size();
let download_filename =
super::APP_NAME.to_owned() + &now.format(FILENAME_DATE_FORMAT)? + ".zip";
super::APP_NAME.to_owned() + &now.format(FILENAME_DATE_FORMAT).unwrap() + ".zip";
(
Box::new(zip_writer),
download_filename,