@@ -127,8 +127,6 @@ impl Client for WebClient {
127127    fn  get_input ( & self ,  day :  Day ,  year :  Year )  -> Result < String ,  ClientError >  { 
128128        tracing:: trace!( "get_input(day=`{day}`, year=`{year}`)" , ) ; 
129129
130-         // TODO: Convert expects and unwraps into errors. 
131- 
132130        // Check if the input for this puzzle is cached locally before fetching 
133131        // it from the Advent of Code service. 
134132        if  let  Some ( input)  = self 
@@ -144,7 +142,7 @@ impl Client for WebClient {
144142
145143        // Cache the puzzle input on disk before returning to avoid repeatedly 
146144        // fetching input from the Advent of Code service. 
147-         self . puzzle_cache . save_input ( & input,  day,  year) . unwrap ( ) ; 
145+         self . puzzle_cache . save_input ( & input,  day,  year) ? ; 
148146        Ok ( input) 
149147    } 
150148
@@ -155,7 +153,6 @@ impl Client for WebClient {
155153        day :  Day , 
156154        year :  Year , 
157155    )  -> Result < CheckResult ,  ClientError >  { 
158-         // TODO: Convert expects and unwraps into errors. 
159156        tracing:: trace!( 
160157            "submit_answer(answer=`{:?}`, part=`{}`, day=`{}`, year=`{}`)" , 
161158            answer, 
@@ -180,7 +177,7 @@ impl Client for WebClient {
180177
181178        // Check if there is an active time out on new submissions prior to 
182179        // submitting to the advent of code service. 
183-         let  mut  user = self . user_cache . load ( & self . config . session_id ) . unwrap ( ) ; 
180+         let  mut  user = self . user_cache . load ( & self . config . session_id ) ? ; 
184181
185182        if  let  Some ( submit_wait_until)  = user. submit_wait_until  { 
186183            if  self . config . start_time  <= submit_wait_until { 
@@ -204,7 +201,7 @@ impl Client for WebClient {
204201            tracing:: debug!( "setting time to wait ({time_to_wait}) to be {wait_until}" ) ; 
205202
206203            user. submit_wait_until  = Some ( wait_until) ; 
207-             self . user_cache . save ( & user) . unwrap ( ) ; 
204+             self . user_cache . save ( & user) ? ; 
208205        } 
209206
210207        // Write the response to the answers database and then save it back to 
@@ -228,11 +225,8 @@ impl Client for WebClient {
228225            } 
229226        } ; 
230227
231-         // TODO: Report errors. 
232228        tracing:: debug!( "Saving answers database to puzzle cache" ) ; 
233-         self . puzzle_cache 
234-             . save_answers ( & answers,  part,  day,  year) 
235-             . unwrap ( ) ; 
229+         self . puzzle_cache . save_answers ( & answers,  part,  day,  year) ?; 
236230
237231        Ok ( check_result) 
238232    } 
0 commit comments