Remove unused code

This commit is contained in:
Lennart K
2026-01-08 23:24:47 +01:00
parent ba13aaa703
commit 002814a564
4 changed files with 51 additions and 27 deletions

View File

@@ -1,7 +1,5 @@
use axum::{http::StatusCode, response::IntoResponse};
use crate::CalDateTimeError;
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
pub enum Error {
#[error("Invalid ics/vcf input: {0}")]
@@ -15,12 +13,6 @@ pub enum Error {
#[error(transparent)]
ParserError(#[from] ical::parser::ParserError),
#[error(transparent)]
CalDateTimeError(#[from] CalDateTimeError),
#[error(transparent)]
RRuleError(#[from] rrule::RRuleError),
}
impl Error {
@@ -30,7 +22,7 @@ impl Error {
Self::InvalidData(_) | Self::MissingCalendar | Self::MissingContact => {
StatusCode::BAD_REQUEST
}
_ => StatusCode::INTERNAL_SERVER_ERROR,
Self::ParserError(_) => StatusCode::INTERNAL_SERVER_ERROR,
}
}
}

View File

@@ -4,24 +4,6 @@ use rustical_xml::{ValueDeserialize, ValueSerialize};
const UTC_DATE_TIME: &str = "%Y%m%dT%H%M%SZ";
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
pub enum CalDateTimeError {
#[error(
"Timezone has X-LIC-LOCATION property to specify a timezone from the Olson database, however its value {0} is invalid"
)]
InvalidOlson(String),
#[error("TZID {0} does not refer to a valid timezone")]
InvalidTZID(String),
#[error("Timestamp doesn't exist because of gap in local time")]
LocalTimeGap,
#[error("Datetime string {0} has an invalid format")]
InvalidDatetimeFormat(String),
#[error("Could not parse datetime {0}")]
ParseError(String),
#[error("Duration string {0} has an invalid format")]
InvalidDurationFormat(String),
}
#[derive(Debug, Clone, Deref, PartialEq, Eq, Hash)]
pub struct UtcDateTime(pub DateTime<Utc>);