@@ -50,7 +50,6 @@ pub mod time_track;
5050/// * `times` - vector of time objects representing the times for each wallpaper in order
5151pub fn wallpaper_current_time (
5252 dir : & str ,
53- dir_count : usize ,
5453 program : Arc < Option < String > > ,
5554 times : & [ Time ] ,
5655) -> Result < ( ) , Box < dyn Error > > {
@@ -68,7 +67,7 @@ pub fn wallpaper_current_time(
6867 let mut filepath_set: String = String :: new ( ) ;
6968 let mut last_image = String :: new ( ) ;
7069
71- let mut loop_time = error_checking ( times, loop_time, dir_count ) ?;
70+ let mut loop_time = error_checking ( times, loop_time) ?;
7271
7372 //this loop is to find where the current time lays, and adjust the wallpaper based on that
7473 for file in dir_iter {
@@ -145,15 +144,15 @@ pub fn wallpaper_listener(
145144 Some ( t) => times = t,
146145 }
147146
148- wallpaper_current_time ( & dir, dir_count , Arc :: clone ( & program) , & times) ?;
147+ wallpaper_current_time ( & dir, Arc :: clone ( & program) , & times) ?;
149148
150149 for time in & times {
151150 let time_fmt = format ! ( "{:02}:{:02}" , time. hours, time. mins) ;
152151 sched_addto = sched_addto. and_every ( 1 . day ( ) ) . at ( time_fmt. as_str ( ) ) ;
153152 }
154153
155154 let sched_closure = move || {
156- let result = wallpaper_current_time ( & dir, dir_count , Arc :: clone ( & program) , & times) ;
155+ let result = wallpaper_current_time ( & dir, Arc :: clone ( & program) , & times) ;
157156
158157 match result {
159158 Ok ( s) => s,
@@ -234,11 +233,7 @@ pub fn sorted_dir_iter(dir: &str) -> IntoIter {
234233 . into_iter ( )
235234}
236235
237- fn error_checking (
238- times : & [ Time ] ,
239- loop_time : Option < & Time > ,
240- dir_count : usize ,
241- ) -> Result < Time , Box < dyn Error > > {
236+ fn error_checking ( times : & [ Time ] , loop_time : Option < & Time > ) -> Result < Time , Box < dyn Error > > {
242237 let times_iter_err = times. iter ( ) ;
243238 let full_time = Time :: new ( 24 * 60 ) ;
244239 let start_range = times
@@ -272,9 +267,6 @@ fn error_checking(
272267 None => Err ( Errors :: ConfigFileError ( ConfigFileErrors :: Empty ) ) ,
273268 Some ( time) => Ok ( time) ,
274269 } ?;
275- if 1440 % dir_count != 0 || dir_count == 0 {
276- return Err ( Errors :: CountCompatError ( dir_count) . into ( ) ) ;
277- }
278270 Ok ( * loop_time)
279271}
280272
0 commit comments