mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 11:42:25 +00:00
Refactor store crate
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
pub mod calendar;
|
||||
pub mod error;
|
||||
pub mod event;
|
||||
pub mod model;
|
||||
pub mod sqlite_store;
|
||||
pub mod store;
|
||||
pub mod timestamps;
|
||||
pub mod timestamp;
|
||||
pub use error::Error;
|
||||
pub use store::CalendarStore;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
timestamps::{parse_duration, CalDateTime},
|
||||
timestamp::{parse_duration, CalDateTime},
|
||||
Error,
|
||||
};
|
||||
use anyhow::{anyhow, Result};
|
||||
5
crates/store/src/model/mod.rs
Normal file
5
crates/store/src/model/mod.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
pub mod calendar;
|
||||
pub mod event;
|
||||
|
||||
pub use calendar::Calendar;
|
||||
pub use event::Event;
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::calendar::Calendar;
|
||||
use crate::event::Event;
|
||||
use crate::model::Calendar;
|
||||
use crate::model::Event;
|
||||
use crate::{CalendarStore, Error};
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
|
||||
@@ -2,7 +2,7 @@ use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::{calendar::Calendar, event::Event};
|
||||
use crate::model::{Calendar, Event};
|
||||
|
||||
#[async_trait]
|
||||
pub trait CalendarStore: Send + Sync + 'static {
|
||||
|
||||
@@ -26,7 +26,7 @@ async fn test_init<CS: CalendarStore>(_store: CS) {
|
||||
#[tokio::test]
|
||||
async fn test_create_event<CS: CalendarStore>(mut store: CS) {
|
||||
store
|
||||
.insert_calendar(rustical_store::calendar::Calendar {
|
||||
.insert_calendar(rustical_store::model::Calendar {
|
||||
id: "test".to_owned(),
|
||||
displayname: Some("Test Calendar".to_owned()),
|
||||
principal: "testuser".to_owned(),
|
||||
|
||||
Reference in New Issue
Block a user