Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing clippy warnings #397

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/check-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo clippy --all
- name: Check clippy for tests
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run check
run: cargo check
- name: Check for H2 patch not being applied
Expand All @@ -58,3 +60,4 @@ jobs:
run: cargo test -- --ignored
- name: Run doc
run: cargo doc --no-deps

28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "agent"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>", "<bfjelds@microsoft.com>"]
edition = "2018"

Expand Down
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
too-many-arguments-threshold = 10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there a lot of functions that have more than the default number of arguments?

2 changes: 1 addition & 1 deletion controller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "controller"
version = "0.6.20"
version = "0.6.21"
authors = ["<bfjelds@microsoft.com>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.20
version: 0.6.21

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.6.20
appVersion: 0.6.21
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "debug-echo-discovery-handler"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "onvif-discovery-handler"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "opcua-discovery-handler"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "udev-discovery-handler"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/debug-echo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-debug-echo"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/onvif/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-onvif"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions discovery-handlers/onvif/src/discovery_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl DiscoveryHandler for DiscoveryHandlerImpl {
let futures: Vec<_> = latest_cameras
.iter()
.filter(|c| !previous_cameras.contains(c))
.map(|c| apply_filters(&discovery_handler_config, &c, &onvif_query))
.map(|c| apply_filters(&discovery_handler_config, c, &onvif_query))
.collect();
let options = futures_util::future::join_all(futures).await;
// Insert newly discovered camera that are not filtered out
Expand Down Expand Up @@ -154,7 +154,7 @@ async fn apply_filters(
) -> Option<(String, Device)> {
info!("apply_filters - device service url {}", device_service_uri);
let (ip_address, mac_address) = match onvif_query
.get_device_ip_and_mac_address(&device_service_uri)
.get_device_ip_and_mac_address(device_service_uri)
.await
{
Ok(ip_and_mac) => ip_and_mac,
Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/onvif/src/discovery_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ pub mod util {

let envelope_as_string = create_onvif_discovery_message(&uuid_str);
socket
.send_to(&envelope_as_string.as_bytes(), multi_socket_addr)
.send_to(envelope_as_string.as_bytes(), multi_socket_addr)
.await?;
Ok(socket)
}
Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/onvif/src/discovery_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ async fn inner_get_device_profile_streaming_uri(
/// Gets the streaming uri for a given profile for an ONVIF camera
async fn inner_is_device_responding(url: &str, http: &impl Http) -> Result<String, anyhow::Error> {
http.post(
&url,
url,
&get_action(DEVICE_WSDL, "GetSystemDateAndTime"),
&GET_SYSTEM_DATE_AND_TIME_TEMPLATE.to_string(),
)
Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/opcua/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-opcua"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion discovery-handlers/udev/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-udev"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion discovery-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-discovery-utils"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion samples/brokers/udev-video-broker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "udev-video-broker"
version = "0.6.20"
version = "0.6.21"
authors = ["Kate Goldenring <kate.goldenring@microsoft.com>", "<bfjelds@microsoft.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion shared/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "akri-shared"
version = "0.6.20"
version = "0.6.21"
authors = ["<bfjelds@microsoft.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion shared/src/akri/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ mod crd_serializeation_tests {
let deserialized: InstanceSpec = serde_json::from_str(json).unwrap();
assert_eq!("blah".to_string(), deserialized.configuration_name);
assert_eq!(1, deserialized.broker_properties.len());
assert_eq!(true, deserialized.shared);
assert!(deserialized.shared);
assert_eq!(2, deserialized.nodes.len());
assert_eq!(2, deserialized.device_usage.len());

Expand Down
16 changes: 8 additions & 8 deletions shared/src/k8s/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,8 @@ pub mod test_ownership {
ownership.get_api_version()
);
assert_eq!("Configuration", &ownership.get_kind());
assert_eq!(true, ownership.get_controller().unwrap());
assert_eq!(true, ownership.get_block_owner_deletion().unwrap());
assert!(ownership.get_controller().unwrap());
assert!(ownership.get_block_owner_deletion().unwrap());
assert_eq!(name, &ownership.get_name());
assert_eq!(uid, &ownership.get_uid());
}
Expand All @@ -601,8 +601,8 @@ pub mod test_ownership {
ownership.get_api_version()
);
assert_eq!("Instance", &ownership.get_kind());
assert_eq!(true, ownership.get_controller().unwrap());
assert_eq!(true, ownership.get_block_owner_deletion().unwrap());
assert!(ownership.get_controller().unwrap());
assert!(ownership.get_block_owner_deletion().unwrap());
assert_eq!(name, &ownership.get_name());
assert_eq!(uid, &ownership.get_uid());
}
Expand All @@ -613,8 +613,8 @@ pub mod test_ownership {
let ownership = OwnershipInfo::new(OwnershipType::Pod, name.to_string(), uid.to_string());
assert_eq!("core/v1", ownership.get_api_version());
assert_eq!("Pod", &ownership.get_kind());
assert_eq!(true, ownership.get_controller().unwrap());
assert_eq!(true, ownership.get_block_owner_deletion().unwrap());
assert!(ownership.get_controller().unwrap());
assert!(ownership.get_block_owner_deletion().unwrap());
assert_eq!(name, &ownership.get_name());
assert_eq!(uid, &ownership.get_uid());
}
Expand All @@ -626,8 +626,8 @@ pub mod test_ownership {
OwnershipInfo::new(OwnershipType::Service, name.to_string(), uid.to_string());
assert_eq!("core/v1", ownership.get_api_version());
assert_eq!("Service", &ownership.get_kind());
assert_eq!(true, ownership.get_controller().unwrap());
assert_eq!(true, ownership.get_block_owner_deletion().unwrap());
assert!(ownership.get_controller().unwrap());
assert!(ownership.get_block_owner_deletion().unwrap());
assert_eq!(name, &ownership.get_name());
assert_eq!(uid, &ownership.get_uid());
}
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.20
0.6.21
2 changes: 1 addition & 1 deletion webhooks/validating/configuration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "webhook-configuration"
version = "0.6.20"
version = "0.6.21"
authors = ["DazWilkin <daz.wilkin@gmail.com>"]
edition = "2018"

Expand Down