Skip to content

Commit 47e3b32

Browse files
committed
chore: clippy fixes
1 parent ff28046 commit 47e3b32

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

src/apis/source/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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(

src/backends/azure.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)