Skip to content

Commit

Permalink
fix: remove std requirement for signing, fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
pv42 committed Aug 23, 2024
1 parent 002fc11 commit 849fd5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mavlink-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ sha2 = { version = "0.10", optional = true }
"embedded-hal-02" = ["dep:nb", "dep:embedded-hal-02"]
"serde" = ["dep:serde", "dep:serde_arrays"]
"tokio-1" = ["dep:tokio"]
"signing" = ["dep:sha2", "std"]
"signing" = ["dep:sha2"]
default = ["std", "tcp", "udp", "direct-serial", "serde"]
5 changes: 3 additions & 2 deletions mavlink/tests/tcp_loopback_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod test_tcp_connections {

use crate::test_shared;

Check warning on line 10 in mavlink/tests/tcp_loopback_tests.rs

View workflow job for this annotation

GitHub Actions / linting

unused import: `crate::test_shared`

warning: unused import: `crate::test_shared` --> mavlink/tests/tcp_loopback_tests.rs:10:9 | 10 | use crate::test_shared; | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default

/// Test whether we can send a message via TCP and receive it OK. This also test signing as a property of a MavConnection if the signing feature is enabled.
/// Test whether we can send a message via TCP and receive it OK. This also test signing as a property of a MavConnection if the signing feature is enabled.
#[test]
pub fn test_tcp_loopback() {
const RECEIVE_CHECK_COUNT: i32 = 5;
Expand All @@ -21,7 +21,8 @@ mod test_tcp_connections {

let server_thread = thread::spawn(move || {
//TODO consider using get_available_port to use a random port
let mut server = mavlink::connect("tcpin:0.0.0.0:14550").expect("Couldn't create server");
let mut server =

Check warning on line 24 in mavlink/tests/tcp_loopback_tests.rs

View workflow job for this annotation

GitHub Actions / linting

variable does not need to be mutable

warning: variable does not need to be mutable --> mavlink/tests/tcp_loopback_tests.rs:24:17 | 24 | let mut server = | ----^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
mavlink::connect("tcpin:0.0.0.0:14550").expect("Couldn't create server");

#[cfg(feature = "signing")]
server.setup_signing(Some(singing_cfg_server));
Expand Down
5 changes: 2 additions & 3 deletions mavlink/tests/test_shared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ pub const COMMON_MSG_HEADER: mavlink::MavHeader = mavlink::MavHeader {

#[cfg(feature = "signing")]
pub const SECRET_KEY: [u8; 32] = [
0x00, 0x01, 0xf2, 0xe3, 0xd4, 0xc5, 0xb6, 0xa7, 0x98, 0x00, 0x70, 0x76, 0x34, 0x32, 0x00,
0x16, 0x22, 0x42, 0x00, 0xcc, 0xff, 0x7a, 0x00, 0x52, 0x75, 0x73, 0x74, 0x00, 0x4d, 0x41,
0x56, 0xb3,
0x00, 0x01, 0xf2, 0xe3, 0xd4, 0xc5, 0xb6, 0xa7, 0x98, 0x00, 0x70, 0x76, 0x34, 0x32, 0x00, 0x16,
0x22, 0x42, 0x00, 0xcc, 0xff, 0x7a, 0x00, 0x52, 0x75, 0x73, 0x74, 0x00, 0x4d, 0x41, 0x56, 0xb3,
];

#[cfg(feature = "common")]
Expand Down

0 comments on commit 849fd5a

Please sign in to comment.