Skip to content

Commit dd7f86a

Browse files
authored
Adds a missing clippy allow (#663)
It also add a simple function on the roundtrip wit that triggers the clippy failure as a way to test that clippy is fixed Signed-off-by: James Sturtevant <[email protected]>
1 parent 63c89ef commit dd7f86a

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/hyperlight_component_util/src/host.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ fn emit_export_extern_decl<'a, 'b, 'c>(
6161
(#(#marshal,)*)
6262
);
6363
let ::std::result::Result::Ok(#ret) = #ret else { panic!("bad return from guest {:?}", #ret) };
64+
#[allow(clippy::unused_unit)]
6465
#unmarshal
6566
}
6667
}

src/hyperlight_host/tests/wit_test.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ impl test::wit::Roundtrip for Host {
155155
) -> test::wit::roundtrip::Testenum {
156156
x
157157
}
158+
159+
fn roundtrip_no_result(&mut self, _x: u32) {}
158160
}
159161

160162
struct TestResource {
@@ -330,6 +332,11 @@ mod wit_test {
330332
make_test! { roundtrip_variant, in arb_testvariant() }
331333
make_test! { roundtrip_enum, in arb_testenum() }
332334

335+
#[test]
336+
fn test_simple_func() {
337+
sb().roundtrip().roundtrip_no_result(42);
338+
}
339+
333340
#[test]
334341
fn test_host_resource() {
335342
{

src/tests/rust_guests/witguest/guest.wit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ interface roundtrip {
2525
roundtrip-tuple: func(x: tuple<string, u8>) -> tuple<string, u8>;
2626
roundtrip-option: func(x: option<string>) -> option<string>;
2727
roundtrip-result: func(x: result<char, string>) -> result<char, string>;
28+
roundtrip-no-result: func(x: u32);
2829

2930
record testrecord {
3031
contents: string,

src/tests/rust_guests/witguest/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ impl test::wit::Roundtrip for Guest {
113113
) -> test::wit::roundtrip::Testenum {
114114
(Host {}).roundtrip_enum(x)
115115
}
116+
fn roundtrip_no_result(&mut self, x: u32) {
117+
(Host {}).roundtrip_no_result(x)
118+
}
116119
}
117120

118121
impl test::wit::TestHostResource for Guest {

0 commit comments

Comments
 (0)