mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
caldav: Replace anyhow!'s with panics where the program should really panic
This commit is contained in:
@@ -278,7 +278,7 @@ impl<C: CalendarStore + ?Sized> ResourceService for CalendarResource<C> {
|
||||
) -> Result<Self, Self::Error> {
|
||||
let cal_store = req
|
||||
.app_data::<Data<RwLock<C>>>()
|
||||
.ok_or(anyhow!("no calendar store in app_data!"))?
|
||||
.expect("no calendar store in app_data!")
|
||||
.clone()
|
||||
.into_inner();
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use crate::Error;
|
||||
use actix_web::{web::Data, HttpRequest};
|
||||
use anyhow::anyhow;
|
||||
use async_trait::async_trait;
|
||||
use rustical_auth::AuthInfo;
|
||||
use rustical_dav::resource::{InvalidProperty, Resource, ResourceService};
|
||||
@@ -85,7 +84,7 @@ impl<C: CalendarStore + ?Sized> ResourceService for EventResource<C> {
|
||||
|
||||
let cal_store = req
|
||||
.app_data::<Data<RwLock<C>>>()
|
||||
.ok_or(anyhow!("no calendar store in app_data!"))?
|
||||
.expect("no calendar store in app_data!")
|
||||
.clone()
|
||||
.into_inner();
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use crate::Error;
|
||||
use actix_web::web::Data;
|
||||
use actix_web::HttpRequest;
|
||||
use anyhow::anyhow;
|
||||
use async_trait::async_trait;
|
||||
use rustical_auth::AuthInfo;
|
||||
use rustical_dav::resource::{InvalidProperty, Resource, ResourceService};
|
||||
@@ -102,7 +101,7 @@ impl<C: CalendarStore + ?Sized> ResourceService for PrincipalResource<C> {
|
||||
}
|
||||
let cal_store = req
|
||||
.app_data::<Data<RwLock<C>>>()
|
||||
.ok_or(anyhow!("no calendar store in app_data!"))?
|
||||
.expect("no calendar store in app_data!")
|
||||
.clone()
|
||||
.into_inner();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user