Skip to content

Commit bc4c291

Browse files
authored
chore: Address new clippy complains (#1568)
1 parent 45940d3 commit bc4c291

File tree

15 files changed

+22
-27
lines changed

15 files changed

+22
-27
lines changed

openstack_cli/src/error.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ pub enum OpenStackCliError {
195195
#[error("valid authentication is missing to be able to rescope the session")]
196196
MissingValidAuthenticationForRescope,
197197

198+
/// URL parsing error
199+
#[error(transparent)]
200+
UrlParse {
201+
/// The source of the error.
202+
#[from]
203+
source: url::ParseError,
204+
},
205+
198206
/// Others.
199207
#[error(transparent)]
200208
Other(#[from] eyre::Report),

openstack_cli/src/identity/v4/user/passkey/register.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ impl PasskeyCommand {
524524
webauthn_authenticator_rs::mozilla::MozillaAuthenticator::new(),
525525
);
526526
match auth.do_registration(
527-
Url::parse("http://localhost:8080").unwrap(),
527+
Url::parse("http://localhost:8080")?,
528528
convert_api_parameters_to_webauthn(pk_request)?,
529529
) {
530530
Ok(rsp) => {

openstack_cli/src/object_store/v1/account/set.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ impl AccountCommand {
9999
.url()
100100
.path_segments()
101101
.ok_or_else(|| eyre!("Object Store endpoint must not point to a bare domain"))?
102-
.filter(|x| !x.is_empty())
103-
.next_back();
102+
.rfind(|x| !x.is_empty());
104103
if let Some(account) = account {
105104
ep_builder.account(account);
106105
}

openstack_cli/src/object_store/v1/account/show.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ impl AccountCommand {
7171
.url()
7272
.path_segments()
7373
.ok_or_else(|| eyre!("Object Store endpoint must not point to a bare domain"))?
74-
.filter(|x| !x.is_empty())
75-
.next_back();
74+
.rfind(|x| !x.is_empty());
7675
if let Some(account) = account {
7776
ep_builder.account(account);
7877
}

openstack_cli/src/object_store/v1/container/create.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ impl ContainerCommand {
7878
.url()
7979
.path_segments()
8080
.ok_or_else(|| eyre!("Object Store endpoint must not point to a bare domain"))?
81-
.filter(|x| !x.is_empty())
82-
.next_back();
81+
.rfind(|x| !x.is_empty());
8382
if let Some(account) = account {
8483
ep_builder.account(account);
8584
}

openstack_cli/src/object_store/v1/container/delete.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ impl ContainerCommand {
7878
.url()
7979
.path_segments()
8080
.ok_or_else(|| eyre!("Object Store endpoint must not point to a bare domain"))?
81-
.filter(|x| !x.is_empty())
82-
.next_back();
81+
.rfind(|x| !x.is_empty());
8382
if let Some(account) = account {
8483
ep_builder.account(account);
8584
}

openstack_cli/src/object_store/v1/container/list.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ impl ContainersCommand {
128128
.url()
129129
.path_segments()
130130
.ok_or_else(|| eyre!("Object Store endpoint must not point to a bare domain"))?
131-
.filter(|x| !x.is_empty())
132-
.next_back();
131+
.rfind(|x| !x.is_empty());
133132
if let Some(account) = account {
134133
ep_builder.account(account);
135134
}

openstack_cli/src/object_store/v1/container/prune.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ impl ContainerCommand {
6666
.url()
6767
.path_segments()
6868
.ok_or_else(|| eyre!("Object Store endpoint must not point to a bare domain"))?
69-
.filter(|x| !x.is_empty())
70-
.next_back()
69+
.rfind(|x| !x.is_empty())
7170
.ok_or_else(|| eyre!("Object Store endpoint must end with project id"))?;
7271
client
7372
.object_store_container_prune_async(account, &self.container, self.prefix.as_ref())

openstack_cli/src/object_store/v1/container/set.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ impl ContainerCommand {
7878
.url()
7979
.path_segments()
8080
.ok_or_else(|| eyre!("Object Store endpoint must not point to a bare domain"))?
81-
.filter(|x| !x.is_empty())
82-
.next_back();
81+
.rfind(|x| !x.is_empty());
8382
if let Some(account) = account {
8483
ep_builder.account(account);
8584
}

openstack_cli/src/object_store/v1/container/show.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ impl ContainerCommand {
7373
.url()
7474
.path_segments()
7575
.ok_or_else(|| eyre!("Object Store endpoint must not point to a bare domain"))?
76-
.filter(|x| !x.is_empty())
77-
.next_back();
76+
.rfind(|x| !x.is_empty());
7877
if let Some(account) = account {
7978
ep_builder.account(account);
8079
}

0 commit comments

Comments
 (0)