@@ -205,7 +205,7 @@ impl XetReader {
205205 let config = config. clone ( ) ;
206206 let merkle_hash = self . merkle_hash ;
207207 let file_hash = self . file_hash . clone ( ) ;
208- let file_range = self . file_range . clone ( ) ;
208+ let file_range = self . file_range ;
209209 let progress_updater = self . progress_updater . take ( ) ;
210210 let handle = tokio:: spawn ( async move {
211211 let downloader = match FileDownloader :: new ( config) . await {
@@ -239,16 +239,16 @@ impl Stream for XetReader {
239239
240240 ReaderState :: Streaming { rx, handle } => {
241241 // Check the task handle first for early error detection.
242- if let Some ( h) = handle {
243- if let Poll :: Ready ( result) = Pin :: new ( h) . poll ( cx) {
244- let result = result . expect ( "download task panicked" ) ;
245- match result {
246- Ok ( _ ) => * handle = None ,
247- Err ( e ) => {
248- this . state = ReaderState :: Completed ;
249- return Poll :: Ready ( Some ( Err ( e ) ) ) ;
250- } ,
251- }
242+ if let Some ( h) = handle
243+ && let Poll :: Ready ( result) = Pin :: new ( h) . poll ( cx)
244+ {
245+ let result = result. expect ( "download task panicked" ) ;
246+ match result {
247+ Ok ( _ ) => * handle = None ,
248+ Err ( e ) => {
249+ this . state = ReaderState :: Completed ;
250+ return Poll :: Ready ( Some ( Err ( e ) ) ) ;
251+ } ,
252252 }
253253 }
254254
0 commit comments