File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -51,17 +51,17 @@ impl LifeLapse {
5151 /// when the LifeLapse is empty.
5252 pub fn extend < I : IntoIterator < Item = TimedLifeChunk > > ( & mut self , iter : I ) {
5353 let new_tokens: Vec < _ > = iter. into_iter ( ) . collect ( ) ;
54-
54+
5555 // Validate invariant: first token must match start time if this is empty
5656 if self . tokens . is_empty ( ) && !new_tokens. is_empty ( ) {
5757 assert_eq ! (
5858 self . start, new_tokens[ 0 ] . start,
5959 "First token start time must match LifeLapse start time"
6060 ) ;
6161 }
62-
62+
6363 self . tokens . extend ( new_tokens) ;
64-
64+
6565 // Recalculate end time to maintain invariant
6666 let d = self . total_duration ( ) ;
6767 self . end = self . start + d;
@@ -80,7 +80,7 @@ impl LifeLapse {
8080 "First token start time must match LifeLapse start time"
8181 ) ;
8282 }
83-
83+
8484 self . end = self . end + item. life_chunk . duration ;
8585 self . tokens . push ( item) ;
8686 }
Original file line number Diff line number Diff line change @@ -50,10 +50,7 @@ pub fn get_all_life_lapses(
5050 ( start_time, all_life_lapses)
5151}
5252
53- pub fn sort_and_filter_life_lapses (
54- all_life_lapses : & mut Vec < LifeLapse > ,
55- start_time : Timestamp ,
56- ) {
53+ pub fn sort_and_filter_life_lapses ( all_life_lapses : & mut Vec < LifeLapse > , start_time : Timestamp ) {
5754 all_life_lapses. sort_by_key ( |ll| ll. start ( ) ) ;
5855
5956 * all_life_lapses = all_life_lapses
@@ -210,7 +207,7 @@ pub(crate) fn get_life_chunk(line: &str) -> LifeChunk {
210207 // XXX: what to do if description is empty (categories self-explaining). Could have None instead.
211208 let user_provided_quadrant = quadrant. is_some ( ) ;
212209 let qu = quadrant. unwrap_or_default ( ) ;
213-
210+
214211 LifeChunk :: new (
215212 description. to_string ( ) ,
216213 duration,
Original file line number Diff line number Diff line change @@ -295,7 +295,7 @@ fn cli_with_separate_summary_and_plan_files() {
295295 assert ! ( plan_path. exists( ) , "Plan file should be created" ) ;
296296
297297 let summary_content = fs:: read_to_string ( & summary_path) . unwrap ( ) ;
298-
298+
299299 // Replace dynamic date with placeholder
300300 let re = Regex :: new ( r"\d{4}-\d{2}-\d{2}\+\d{2}:\d{2} \(all past summaries\)" ) . unwrap ( ) ;
301301 let normalized = re. replace ( & summary_content, "<DATE> (all past summaries)" ) ;
@@ -332,11 +332,9 @@ fn cli_with_nonexistent_config_fails() {
332332 let mut cmd = assert_cmd:: Command :: from_std ( Command :: new ( env ! ( "CARGO_BIN_EXE_tiro" ) ) ) ;
333333 cmd. arg ( "--config" ) . arg ( "/nonexistent/config.toml" ) ;
334334
335- cmd. assert ( )
336- . failure ( )
337- . stderr ( predicate:: str:: contains (
338- "Cannot proceed without valid configuration path" ,
339- ) ) ;
335+ cmd. assert ( ) . failure ( ) . stderr ( predicate:: str:: contains (
336+ "Cannot proceed without valid configuration path" ,
337+ ) ) ;
340338}
341339
342340#[ test]
You can’t perform that action at this time.
0 commit comments