Reformat project
This commit is contained in:
parent
1d760a2415
commit
3c12e3ff29
@ -8,7 +8,8 @@ fn main() -> Result<(), String> {
|
|||||||
let out_dir = env::var_os("TRUNK_STAGING_DIR").unwrap_or("target/default_configs".into());
|
let out_dir = env::var_os("TRUNK_STAGING_DIR").unwrap_or("target/default_configs".into());
|
||||||
fs::create_dir_all(&out_dir).map_err(|e| format!("failed to create target directory: {e}"))?;
|
fs::create_dir_all(&out_dir).map_err(|e| format!("failed to create target directory: {e}"))?;
|
||||||
|
|
||||||
create_default_config::<SessionConfig, _>("session_config", &out_dir).map_err(|e| format!("Failed to create session_config: {e}"))?;
|
create_default_config::<SessionConfig, _>("session_config", &out_dir)
|
||||||
|
.map_err(|e| format!("Failed to create session_config: {e}"))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,9 @@ use serde::{Deserialize, Serialize};
|
|||||||
use session_iter::day::Day;
|
use session_iter::day::Day;
|
||||||
use session_iter::session::iter::{DatedSession, DatedSessionIter};
|
use session_iter::session::iter::{DatedSession, DatedSessionIter};
|
||||||
use session_iter::session::rule::WeekdayOfMonth;
|
use session_iter::session::rule::WeekdayOfMonth;
|
||||||
use session_iter::session::{Alternation, Cancellation, Dated, ExtraSession, RegularSession, Session, WithNote};
|
use session_iter::session::{
|
||||||
|
Alternation, Cancellation, Dated, ExtraSession, RegularSession, Session, WithNote,
|
||||||
|
};
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn App() -> impl IntoView {
|
pub fn App() -> impl IntoView {
|
||||||
@ -188,7 +190,12 @@ impl Default for SessionConfig {
|
|||||||
.except(
|
.except(
|
||||||
NEXT_SUN_SESSION,
|
NEXT_SUN_SESSION,
|
||||||
Alternation {
|
Alternation {
|
||||||
new_day: Some(NEXT_SUN_SESSION.checked_sub_days(Days::new(1)).unwrap().into()),
|
new_day: Some(
|
||||||
|
NEXT_SUN_SESSION
|
||||||
|
.checked_sub_days(Days::new(1))
|
||||||
|
.unwrap()
|
||||||
|
.into(),
|
||||||
|
),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@ -2,4 +2,3 @@ pub mod day;
|
|||||||
pub mod session;
|
pub mod session;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test_util;
|
mod test_util;
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ impl DatedSessionIter {
|
|||||||
pub fn new<D, S>(start_date: D, sessions: S) -> DatedSessionIter
|
pub fn new<D, S>(start_date: D, sessions: S) -> DatedSessionIter
|
||||||
where
|
where
|
||||||
D: Into<Day>,
|
D: Into<Day>,
|
||||||
S: IntoIterator<Item=Session>,
|
S: IntoIterator<Item = Session>,
|
||||||
{
|
{
|
||||||
let current_date = start_date.into();
|
let current_date = start_date.into();
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ pub struct SessionDayIter<R> {
|
|||||||
|
|
||||||
impl<R, S> Iterator for SessionDayIter<R>
|
impl<R, S> Iterator for SessionDayIter<R>
|
||||||
where
|
where
|
||||||
R: Deref<Target=S>,
|
R: Deref<Target = S>,
|
||||||
S: SessionRuleLike,
|
S: SessionRuleLike,
|
||||||
{
|
{
|
||||||
type Item = Day;
|
type Item = Day;
|
||||||
@ -67,7 +67,7 @@ where
|
|||||||
|
|
||||||
impl<R> SessionDayIter<R>
|
impl<R> SessionDayIter<R>
|
||||||
where
|
where
|
||||||
R: Deref<Target=SessionRule>,
|
R: Deref<Target = SessionRule>,
|
||||||
{
|
{
|
||||||
pub fn to_owned(&self) -> SessionDayIter<SessionRule> {
|
pub fn to_owned(&self) -> SessionDayIter<SessionRule> {
|
||||||
SessionDayIter {
|
SessionDayIter {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user