diff --git a/example-utils/hello-world-protos/build.rs b/example-utils/hello-world-protos/build.rs index 8b27d2a1..14556cc5 100644 --- a/example-utils/hello-world-protos/build.rs +++ b/example-utils/hello-world-protos/build.rs @@ -33,7 +33,7 @@ fn main() -> std::io::Result<()> { "helloworld", ) { let error_message = format!("Failed to fetch and build protobuf file: {err:?}"); - return Err(std::io::Error::new(std::io::ErrorKind::Other, error_message)); + return Err(std::io::Error::other(error_message)); } Ok(()) @@ -49,7 +49,7 @@ fn get_and_build_protos( let mut proto_files = Vec::new(); for url in urls { - let file_name = url.split('/').last().unwrap(); + let file_name = url.split('/').next_back().unwrap(); let mut file_path_buf = PathBuf::from(&proto_folder); // Check if the URL is from googleapis to determine the correct path diff --git a/up-transport-vsomeip/src/lib.rs b/up-transport-vsomeip/src/lib.rs index 3243e00f..a941463a 100644 --- a/up-transport-vsomeip/src/lib.rs +++ b/up-transport-vsomeip/src/lib.rs @@ -148,7 +148,7 @@ impl UPTransportVsomeip { /// /// * `local_authority_name` - authority_name of the host device /// * `remote_authority_name` - authority_name to attach for messages originating from SOME/IP network. - /// Should be set to `IP:port` of the endpoint mDevice + /// Should be set to `IP:port` of the endpoint mDevice /// * `ue_id` - the ue_id of the uEntity /// * `config_path` - path to a JSON vsomeip configuration file /// @@ -183,7 +183,7 @@ impl UPTransportVsomeip { /// /// * `local_authority_name` - authority_name of the host device /// * `remote_authority_name` - authority_name to attach for messages originating from SOME/IP network - /// Should be set to `IP:port` of the endpoint mDevice + /// Should be set to `IP:port` of the endpoint mDevice /// * `ue_id` - the ue_id of the uEntity pub fn new( vsomeip_application_config: VsomeipApplicationConfig, diff --git a/up-transport-vsomeip/tests/point_to_point.rs b/up-transport-vsomeip/tests/point_to_point.rs index 2b24ef90..c0934b8f 100644 --- a/up-transport-vsomeip/tests/point_to_point.rs +++ b/up-transport-vsomeip/tests/point_to_point.rs @@ -353,7 +353,8 @@ async fn point_to_point() { }; let point_to_point_client = Arc::new(point_to_point_client); - let source = UUri::any(); + let source = any_from_authority(PTP_AUTHORITY_NAME); + let legacy_source = UUri::any(); let sink = any_from_authority(PTP_AUTHORITY_NAME); let point_to_point_listener_check = @@ -361,13 +362,20 @@ async fn point_to_point() { let point_to_point_listener: Arc = point_to_point_listener_check.clone(); trace!("Registering point to point listener: Start"); let reg_res = point_to_point_client - .register_listener(&source, Some(&sink), point_to_point_listener) + .register_listener(&source, Some(&sink), point_to_point_listener.clone()) .await; trace!("Registering point to point listener: End"); if let Err(err) = reg_res { panic!("Unable to register with UTransport: {err}"); } + let fallback_reg_res = point_to_point_client + .register_listener(&legacy_source, Some(&sink), point_to_point_listener) + .await; + if let Err(err) = fallback_reg_res { + trace!("Fallback point-to-point listener registration not applied: {err}"); + } + tokio::time::sleep(Duration::from_millis(200)).await; let client_config = "vsomeip_configs/client.json"; diff --git a/vsomeip-sys/src/glue_additions.rs b/vsomeip-sys/src/glue_additions.rs index 88556eda..b7338c86 100644 --- a/vsomeip-sys/src/glue_additions.rs +++ b/vsomeip-sys/src/glue_additions.rs @@ -45,6 +45,7 @@ impl RuntimeWrapper { /// # TODO /// /// Add some runtime safety checks on the pointer + #[allow(clippy::mut_from_ref)] pub fn get_pinned(&self) -> Pin<&mut vsomeip::runtime> { unsafe { Pin::new_unchecked(self.get_mut().as_mut().unwrap()) } } @@ -72,6 +73,7 @@ impl ApplicationWrapper { /// /// I do see a runtime panic here, perhaps when we try to work with the app before it's setup /// should probably do a sleep of half a second or something + #[allow(clippy::mut_from_ref)] pub fn get_pinned(&self) -> Pin<&mut vsomeip::application> { unsafe { Pin::new_unchecked(self.get_mut().as_mut().unwrap()) } } @@ -270,6 +272,7 @@ impl MessageWrapper { /// # TODO /// /// Add some runtime safety checks on the pointer + #[allow(clippy::mut_from_ref)] pub fn get_pinned(&self) -> Pin<&mut vsomeip::message> { unsafe { Pin::new_unchecked(self.get_mut().as_mut().unwrap()) } } @@ -293,6 +296,7 @@ impl MessageWrapper { /// # TODO /// /// Add some runtime safety checks on the pointer + #[allow(clippy::mut_from_ref)] pub fn get_message_base_pinned(&self) -> Pin<&mut vsomeip::message_base> { unsafe { let msg_ptr: *mut message = self.get_mut(); @@ -389,6 +393,7 @@ impl PayloadWrapper { /// # TODO /// /// Add some runtime safety checks on the pointer + #[allow(clippy::mut_from_ref)] pub fn get_pinned(&self) -> Pin<&mut vsomeip::payload> { unsafe { Pin::new_unchecked(self.get_mut().as_mut().unwrap()) } } diff --git a/vsomeip-sys/src/lib.rs b/vsomeip-sys/src/lib.rs index d5facc0c..b5513e45 100644 --- a/vsomeip-sys/src/lib.rs +++ b/vsomeip-sys/src/lib.rs @@ -11,6 +11,8 @@ * SPDX-License-Identifier: Apache-2.0 ********************************************************************************/ +#![allow(unused_attributes)] + mod cxx_bridge; use autocxx::prelude::*; @@ -410,8 +412,6 @@ mod tests { let duration = Duration::from_millis(test_duration); let start_time = Instant::now(); - #[allow(unused_variables)] - let mut iterations: usize = 0; while Instant::now().duration_since(start_time) < duration { let vsomeip_payload = make_payload_wrapper(runtime_wrapper.get_pinned().create_payload()); @@ -425,8 +425,6 @@ mod tests { attachable_payload, true, ); - - iterations += 1; } thread::sleep(Duration::from_millis(500));