Skip to content

Commit

Permalink
report 0 args for ()
Browse files Browse the repository at this point in the history
  • Loading branch information
catornot committed Apr 23, 2024
1 parent 8bb9636 commit 3ba1de7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/high/squirrel_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl PushToSquirrelVm for () {
const DEFAULT_RESULT: SQRESULT = SQRESULT::SQRESULT_NULL;

#[inline]
fn push_to_sqvm(self, sqvm: NonNull<HSquirrelVM>, sqfunctions: &SquirrelFunctions) {}
fn push_to_sqvm(self, _: NonNull<HSquirrelVM>, _: &SquirrelFunctions) {}
}

// Return Trait
Expand Down Expand Up @@ -164,8 +164,14 @@ pub trait IntoSquirrelArgs: Sync + Send {

impl<T: PushToSquirrelVm + Send + Sync + 'static> IntoSquirrelArgs for T {
fn into_push(self, sqvm: NonNull<HSquirrelVM>, sqfunctions: &'static SquirrelFunctions) -> i32 {
self.push_to_sqvm(sqvm, sqfunctions);
1
// hack :(
// no specialization
if T::DEFAULT_RESULT != SQRESULT::SQRESULT_NULL {
self.push_to_sqvm(sqvm, sqfunctions);
1
} else {
0
}
}
}

Expand Down

0 comments on commit 3ba1de7

Please sign in to comment.