Skip to content

Commit 9e35e3d

Browse files
style(moonbit): fix fmt and clippy
1 parent d71ee98 commit 9e35e3d

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

crates/moonbit/src/async_support.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ impl AsyncSupport {
155155
impl<'a> InterfaceGenerator<'a> {
156156
/// Builds the MoonBit body for async imports, wiring wasm subtasks into the
157157
/// runtime and lowering/lifting payloads as needed.
158+
#[allow(dead_code, reason = "used by follow-up async generation work")]
158159
pub(super) fn generate_async_import_function(
159160
&mut self,
160161
func: &Function,
@@ -487,21 +488,21 @@ fn {table_name}() -> {ffi}{camel_kind}VTable[{result}] {{
487488
types: &[Type],
488489
operands: &[String],
489490
indirect: bool,
490-
module: &str,
491+
_module: &str,
491492
) -> String {
492493
let mut f = FunctionBindgen::new(self, Box::new([]));
493494
abi::deallocate_lists_in_types(f.interface_gen.resolve, types, operands, indirect, &mut f);
494495
f.src
495496
}
496497

497-
fn lift_from_memory(&mut self, address: &str, ty: &Type, module: &str) -> (String, String) {
498+
fn lift_from_memory(&mut self, address: &str, ty: &Type, _module: &str) -> (String, String) {
498499
let mut f = FunctionBindgen::new(self, Box::new([]));
499500

500501
let result = abi::lift_from_memory(f.interface_gen.resolve, &mut f, address.into(), ty);
501502
(f.src, result)
502503
}
503504

504-
fn lower_to_memory(&mut self, address: &str, value: &str, ty: &Type, module: &str) -> String {
505+
fn lower_to_memory(&mut self, address: &str, value: &str, ty: &Type, _module: &str) -> String {
505506
let mut f = FunctionBindgen::new(self, Box::new([]));
506507
abi::lower_to_memory(
507508
f.interface_gen.resolve,

crates/moonbit/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl WorldGenerator for MoonBit {
287287
if let Some(content) = &resolve.interfaces[id].docs.contents
288288
&& !content.is_empty()
289289
{
290-
files.push(&format!("{}/README.md", directory), content.as_bytes());
290+
files.push(&format!("{directory}/README.md"), content.as_bytes());
291291
}
292292

293293
// Source
@@ -362,7 +362,7 @@ impl WorldGenerator for MoonBit {
362362
if let Some(content) = &resolve.worlds[world].docs.contents
363363
&& !content.is_empty()
364364
{
365-
files.push(&format!("{}/README.md", directory), content.as_bytes());
365+
files.push(&format!("{directory}/README.md"), content.as_bytes());
366366
}
367367
// Source
368368
let mut src = Source::default();

crates/test/src/moonbit.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ impl LanguageMethods for MoonBit {
2525
}
2626

2727
fn default_bindgen_args(&self) -> &[&str] {
28-
&["--derive-debug", "--derive-show", "--derive-eq", "--derive-error"]
28+
&[
29+
"--derive-debug",
30+
"--derive-show",
31+
"--derive-eq",
32+
"--derive-error",
33+
]
2934
}
3035

3136
fn prepare(&self, runner: &mut Runner) -> anyhow::Result<()> {

0 commit comments

Comments
 (0)