mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-30 03:28:23 +00:00
Remove unused code
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
use axum::{http::StatusCode, response::IntoResponse};
|
use axum::{http::StatusCode, response::IntoResponse};
|
||||||
|
|
||||||
use crate::CalDateTimeError;
|
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
|
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("Invalid ics/vcf input: {0}")]
|
#[error("Invalid ics/vcf input: {0}")]
|
||||||
@@ -15,12 +13,6 @@ pub enum Error {
|
|||||||
|
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
ParserError(#[from] ical::parser::ParserError),
|
ParserError(#[from] ical::parser::ParserError),
|
||||||
|
|
||||||
#[error(transparent)]
|
|
||||||
CalDateTimeError(#[from] CalDateTimeError),
|
|
||||||
|
|
||||||
#[error(transparent)]
|
|
||||||
RRuleError(#[from] rrule::RRuleError),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Error {
|
impl Error {
|
||||||
@@ -30,7 +22,7 @@ impl Error {
|
|||||||
Self::InvalidData(_) | Self::MissingCalendar | Self::MissingContact => {
|
Self::InvalidData(_) | Self::MissingCalendar | Self::MissingContact => {
|
||||||
StatusCode::BAD_REQUEST
|
StatusCode::BAD_REQUEST
|
||||||
}
|
}
|
||||||
_ => StatusCode::INTERNAL_SERVER_ERROR,
|
Self::ParserError(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,24 +4,6 @@ use rustical_xml::{ValueDeserialize, ValueSerialize};
|
|||||||
|
|
||||||
const UTC_DATE_TIME: &str = "%Y%m%dT%H%M%SZ";
|
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)]
|
#[derive(Debug, Clone, Deref, PartialEq, Eq, Hash)]
|
||||||
pub struct UtcDateTime(pub DateTime<Utc>);
|
pub struct UtcDateTime(pub DateTime<Utc>);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
source: src/integration_tests/caldav/calendar.rs
|
||||||
|
assertion_line: 145
|
||||||
|
expression: body
|
||||||
|
---
|
||||||
|
BEGIN:VCALENDAR
|
||||||
|
VERSION:2.0
|
||||||
|
PRODID:RustiCal Export
|
||||||
|
CALSCALE:GREGORIAN
|
||||||
|
X-WR-CALNAME:Calendar
|
||||||
|
X-WR-CALDESC:Description
|
||||||
|
X-WR-CALCOLOR:#00FF00
|
||||||
|
X-WR-TIMEZONE:US/Eastern
|
||||||
|
END:VCALENDAR
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
source: src/integration_tests/carddav/addressbook.rs
|
||||||
|
assertion_line: 446
|
||||||
|
expression: body
|
||||||
|
---
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<multistatus xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav" xmlns:CS="http://calendarserver.org/ns/" xmlns:PUSH="https://bitfire.at/webdav-push">
|
||||||
|
<response>
|
||||||
|
<href>/carddav/principal/user/contacts/newcard.vcf</href>
|
||||||
|
<propstat>
|
||||||
|
<prop>
|
||||||
|
<getetag>"ea0bf4a2ce7ef84606a4cf9235776dbc11b3e7ce351ddf35f27cbc0088acca7e"</getetag>
|
||||||
|
<CARD:address-data>BEGIN:VCARD
|
||||||
|
VERSION:3.0
|
||||||
|
FN:Cyrus Daboo
|
||||||
|
N:Daboo;Cyrus
|
||||||
|
ADR;TYPE=POSTAL:;2822 Email HQ;Suite 2821;RFCVille;PA;15213;USA
|
||||||
|
EMAIL;TYPE=INTERNET,PREF:cyrus@example.com
|
||||||
|
NICKNAME:me
|
||||||
|
NOTE:Example VCard.
|
||||||
|
ORG:Self Employed
|
||||||
|
TEL;TYPE=WORK,VOICE:412 605 0499
|
||||||
|
TEL;TYPE=FAX:412 605 0705
|
||||||
|
URL:http://www.example.com
|
||||||
|
UID:1234-5678-9000-1
|
||||||
|
END:VCARD
|
||||||
|
</CARD:address-data>
|
||||||
|
</prop>
|
||||||
|
<status>HTTP/1.1 200 OK</status>
|
||||||
|
</propstat>
|
||||||
|
</response>
|
||||||
|
<response>
|
||||||
|
<href>/home/bernard/addressbook/vcf1.vcf</href>
|
||||||
|
<status>HTTP/1.1 404 Not Found</status>
|
||||||
|
</response>
|
||||||
|
</multistatus>
|
||||||
Reference in New Issue
Block a user