Skip to content

Commit f5a57d6

Browse files
Merge branch 'parse-error-reason'
2 parents 6db0ed8 + 06a4392 commit f5a57d6

File tree

6 files changed

+138
-104
lines changed

6 files changed

+138
-104
lines changed

Cargo.lock

Lines changed: 32 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ reqwest = { version = "0.12", features = [
1717
"__rustls",
1818
"rustls-tls-native-roots",
1919
] }
20-
rabbitmq_http_client = { version = "0.65.0", features = [
20+
rabbitmq_http_client = { git = "https://github.com/mkuratczyk/rabbitmq-http-api-rs", branch = "parse-error-reason", features = [
2121
"blocking",
2222
"tabled",
2323
] }

src/commands.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn list_policies_in_and_applying_to(
129129
let policies = client.list_policies_in(vhost)?;
130130
Ok(policies
131131
.into_iter()
132-
.filter(|pol| apply_to.does_apply_to(pol.apply_to.clone()))
132+
.filter(|pol| apply_to.does_apply_to(pol.apply_to))
133133
.collect())
134134
}
135135

@@ -139,10 +139,10 @@ pub fn list_matching_policies_in(
139139
name: &str,
140140
typ: PolicyTarget,
141141
) -> ClientResult<Vec<responses::Policy>> {
142-
let candidates = list_policies_in_and_applying_to(client, vhost, typ.clone())?;
142+
let candidates = list_policies_in_and_applying_to(client, vhost, typ)?;
143143
Ok(candidates
144144
.into_iter()
145-
.filter(|pol| pol.does_match_name(vhost, name, typ.clone()))
145+
.filter(|pol| pol.does_match_name(vhost, name, typ))
146146
.collect())
147147
}
148148

@@ -165,7 +165,7 @@ pub fn list_operator_policies_in_and_applying_to(
165165
let policies = client.list_operator_policies_in(vhost)?;
166166
Ok(policies
167167
.into_iter()
168-
.filter(|pol| apply_to.does_apply_to(pol.apply_to.clone()))
168+
.filter(|pol| apply_to.does_apply_to(pol.apply_to))
169169
.collect())
170170
}
171171

@@ -175,10 +175,10 @@ pub fn list_matching_operator_policies_in(
175175
name: &str,
176176
typ: PolicyTarget,
177177
) -> ClientResult<Vec<responses::Policy>> {
178-
let candidates = list_operator_policies_in_and_applying_to(client, vhost, typ.clone())?;
178+
let candidates = list_operator_policies_in_and_applying_to(client, vhost, typ)?;
179179
Ok(candidates
180180
.into_iter()
181-
.filter(|pol| pol.does_match_name(vhost, name, typ.clone()))
181+
.filter(|pol| pol.does_match_name(vhost, name, typ))
182182
.collect())
183183
}
184184

@@ -1578,7 +1578,7 @@ pub fn declare_policy(
15781578
vhost,
15791579
name,
15801580
pattern,
1581-
apply_to: apply_to.clone(),
1581+
apply_to,
15821582
priority: priority.parse::<i32>().unwrap(),
15831583
definition: parsed_definition,
15841584
};
@@ -1606,7 +1606,7 @@ pub fn declare_operator_policy(
16061606
vhost,
16071607
name: &name,
16081608
pattern: &pattern,
1609-
apply_to: apply_to.clone(),
1609+
apply_to,
16101610
priority: priority.parse::<i32>().unwrap(),
16111611
definition: parsed_definition,
16121612
};
@@ -1832,7 +1832,7 @@ pub fn delete_policy_definition_keys(
18321832
let str_keys: Vec<&str> = keys.iter().map(AsRef::as_ref).collect::<Vec<_>>();
18331833

18341834
let pol = client.get_policy(vhost, &name)?;
1835-
let updated_pol = pol.without_keys(str_keys);
1835+
let updated_pol = pol.without_keys(&str_keys);
18361836

18371837
let params = PolicyParams::from(&updated_pol);
18381838
client.declare_policy(&params)
@@ -1852,7 +1852,7 @@ pub fn delete_policy_definition_keys_in(
18521852
let str_keys: Vec<&str> = keys.iter().map(AsRef::as_ref).collect::<Vec<_>>();
18531853

18541854
for pol in pols {
1855-
let updated_pol = pol.without_keys(str_keys.clone());
1855+
let updated_pol = pol.without_keys(&str_keys);
18561856

18571857
let params = PolicyParams::from(&updated_pol);
18581858
client.declare_policy(&params)?
@@ -1875,7 +1875,7 @@ pub fn delete_operator_policy_definition_keys(
18751875
let str_keys: Vec<&str> = keys.iter().map(AsRef::as_ref).collect::<Vec<_>>();
18761876

18771877
let pol = client.get_operator_policy(vhost, &name)?;
1878-
let updated_pol = pol.without_keys(str_keys);
1878+
let updated_pol = pol.without_keys(&str_keys);
18791879

18801880
let params = PolicyParams::from(&updated_pol);
18811881
client.declare_operator_policy(&params)
@@ -1895,7 +1895,7 @@ pub fn delete_operator_policy_definition_keys_in(
18951895
let str_keys: Vec<&str> = keys.iter().map(AsRef::as_ref).collect::<Vec<_>>();
18961896

18971897
for pol in pols {
1898-
let updated_pol = pol.without_keys(str_keys.clone());
1898+
let updated_pol = pol.without_keys(&str_keys);
18991899

19001900
let params = PolicyParams::from(&updated_pol);
19011901
client.declare_operator_policy(&params)?

0 commit comments

Comments
 (0)