File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,8 +254,7 @@ impl Api for SourceApi {
254254 ) -> Result < Account , BackendError > {
255255 // Create headers
256256 let mut headers = self . build_source_headers ( ) ;
257- if user_identity. api_key . is_some ( ) {
258- let api_key = user_identity. api_key . unwrap ( ) ;
257+ if let Some ( api_key) = user_identity. api_key {
259258 headers. insert (
260259 reqwest:: header:: AUTHORIZATION ,
261260 reqwest:: header:: HeaderValue :: from_str (
@@ -578,8 +577,7 @@ impl SourceApi {
578577 ) -> Result < Vec < RepositoryPermission > , BackendError > {
579578 // Create headers
580579 let mut headers = self . build_source_headers ( ) ;
581- if user_identity. api_key . is_some ( ) {
582- let api_key = user_identity. api_key . unwrap ( ) ;
580+ if let Some ( api_key) = user_identity. api_key {
583581 headers. insert (
584582 reqwest:: header:: AUTHORIZATION ,
585583 reqwest:: header:: HeaderValue :: from_str (
Original file line number Diff line number Diff line change @@ -246,18 +246,13 @@ impl Repository for AzureRepository {
246246 . into_stream ( ) ;
247247
248248 if let Some ( Ok ( blob) ) = stream. next ( ) . await {
249- if blob. max_results . is_some ( ) {
250- result. max_keys = blob . max_results . unwrap ( ) as i64 ;
249+ if let Some ( max_results ) = blob. max_results {
250+ result. max_keys = max_results as i64 ;
251251 }
252252
253- if blob. next_marker . is_some ( ) {
253+ if let Some ( next_marker ) = blob. next_marker {
254254 result. is_truncated = true ;
255- result. next_continuation_token = Some (
256- blob. next_marker
257- . unwrap_or ( NextMarker :: new ( "" . to_string ( ) ) )
258- . as_str ( )
259- . to_string ( ) ,
260- ) ;
255+ result. next_continuation_token = Some ( next_marker. as_str ( ) . to_string ( ) ) ;
261256 }
262257
263258 for blob_item in blob. blobs . items {
You can’t perform that action at this time.
0 commit comments