caldav: Replace anyhow!'s with panics where the program should really panic

This commit is contained in:
Lennart
2024-09-29 12:57:07 +02:00
parent 93e28a1a32
commit 1b438ea98a
3 changed files with 3 additions and 5 deletions

View File

@@ -278,7 +278,7 @@ impl<C: CalendarStore + ?Sized> ResourceService for CalendarResource<C> {
) -> Result<Self, Self::Error> { ) -> Result<Self, Self::Error> {
let cal_store = req let cal_store = req
.app_data::<Data<RwLock<C>>>() .app_data::<Data<RwLock<C>>>()
.ok_or(anyhow!("no calendar store in app_data!"))? .expect("no calendar store in app_data!")
.clone() .clone()
.into_inner(); .into_inner();

View File

@@ -1,6 +1,5 @@
use crate::Error; use crate::Error;
use actix_web::{web::Data, HttpRequest}; use actix_web::{web::Data, HttpRequest};
use anyhow::anyhow;
use async_trait::async_trait; use async_trait::async_trait;
use rustical_auth::AuthInfo; use rustical_auth::AuthInfo;
use rustical_dav::resource::{InvalidProperty, Resource, ResourceService}; use rustical_dav::resource::{InvalidProperty, Resource, ResourceService};
@@ -85,7 +84,7 @@ impl<C: CalendarStore + ?Sized> ResourceService for EventResource<C> {
let cal_store = req let cal_store = req
.app_data::<Data<RwLock<C>>>() .app_data::<Data<RwLock<C>>>()
.ok_or(anyhow!("no calendar store in app_data!"))? .expect("no calendar store in app_data!")
.clone() .clone()
.into_inner(); .into_inner();

View File

@@ -1,7 +1,6 @@
use crate::Error; use crate::Error;
use actix_web::web::Data; use actix_web::web::Data;
use actix_web::HttpRequest; use actix_web::HttpRequest;
use anyhow::anyhow;
use async_trait::async_trait; use async_trait::async_trait;
use rustical_auth::AuthInfo; use rustical_auth::AuthInfo;
use rustical_dav::resource::{InvalidProperty, Resource, ResourceService}; use rustical_dav::resource::{InvalidProperty, Resource, ResourceService};
@@ -102,7 +101,7 @@ impl<C: CalendarStore + ?Sized> ResourceService for PrincipalResource<C> {
} }
let cal_store = req let cal_store = req
.app_data::<Data<RwLock<C>>>() .app_data::<Data<RwLock<C>>>()
.ok_or(anyhow!("no calendar store in app_data!"))? .expect("no calendar store in app_data!")
.clone() .clone()
.into_inner(); .into_inner();