Skip to content

Commit

Permalink
Remove no_float features.
Browse files Browse the repository at this point in the history
  • Loading branch information
schungx committed Oct 8, 2024
1 parent f9c459f commit 158b537
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
4 changes: 0 additions & 4 deletions codegen/src/test/custom_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ mod custom_type_tests {
#[derive(Clone, CustomType)]
pub struct Bar(
#[rhai_type(skip)]
#[cfg(not(feature = "no_float"))]
rhai::FLOAT,
INT,
#[rhai_type(name = "boo", readonly)]
Expand Down Expand Up @@ -49,7 +48,6 @@ mod custom_type_tests {
#[derive(CustomType)]
#[rhai_type(skip, name = "MyFoo", extra = Self::build_extra)]
pub struct Foo {
#[cfg(not(feature = "no_float"))]
#[rhai_type(skip)]
_dummy: rhai::FLOAT,
#[rhai_type(get = get_bar)]
Expand Down Expand Up @@ -100,7 +98,6 @@ mod custom_type_tests {
#[derive(Clone, CustomType)]
pub struct Bar(
#[rhai_type(skip)]
#[cfg(not(feature = "no_float"))]
rhai::FLOAT,
INT,
/// boo comments.
Expand Down Expand Up @@ -143,7 +140,6 @@ mod custom_type_tests {
#[derive(CustomType)]
#[rhai_type(skip, name = "MyFoo", extra = Self::build_extra)]
pub struct Foo {
#[cfg(not(feature = "no_float"))]
#[rhai_type(skip)]
_dummy: rhai::FLOAT,
#[rhai_type(get = get_bar)]
Expand Down
4 changes: 0 additions & 4 deletions codegen/src/test/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,6 @@ mod generate_tests {
fn one_fn_with_cfg_module() {
let input_tokens: TokenStream = quote! {
pub mod one_fn {
#[cfg(not(feature = "no_float"))]
pub mod it_is {
pub fn increment(x: &mut FLOAT) {
*x += 1.0 as FLOAT;
Expand All @@ -1482,7 +1481,6 @@ mod generate_tests {
let expected_tokens = quote! {
#[allow(clippy::needless_pass_by_value, clippy::needless_pass_by_ref_mut)]
pub mod one_fn {
#[cfg(not(feature = "no_float"))]
#[allow(clippy::needless_pass_by_value, clippy::needless_pass_by_ref_mut)]
pub mod it_is {
pub fn increment(x: &mut FLOAT) {
Expand Down Expand Up @@ -1541,10 +1539,8 @@ mod generate_tests {
#[inline(always)]
pub fn rhai_generate_into_module(_m: &mut Module, _flatten: bool) {
if _flatten {
#[cfg(not(feature = "no_float"))]
self::it_is::rhai_generate_into_module(_m, _flatten);
} else {
#[cfg(not(feature = "no_float"))]
_m.set_sub_module("it_is", self::it_is::rhai_module_generate());
}
}
Expand Down
5 changes: 1 addition & 4 deletions codegen/tests/test_custom_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use rhai::{CustomType, Engine, TypeBuilder, INT};

#[derive(Clone, CustomType)]
pub struct Bar(
#[rhai_type(skip)]
#[cfg(not(feature = "no_float"))] // check other attributes
rhai::FLOAT,
#[rhai_type(skip)] rhai::FLOAT,

Check warning on line 7 in codegen/tests/test_custom_type.rs

View workflow job for this annotation

GitHub Actions / Codegen Build (stable, ubuntu-latest, false, --features metadata)

field `0` is never read
INT,
#[rhai_type(name = "boo", readonly)] String,
Vec<INT>,
Expand All @@ -15,7 +13,6 @@ pub struct Bar(
#[derive(Clone, Default, CustomType)]
#[rhai_type(name = "MyFoo", extra = Self::build_extra)]
pub struct Foo {
#[cfg(not(feature = "no_float"))] // check other attributes
#[rhai_type(skip)]
_dummy: rhai::FLOAT,
#[rhai_type(get = get_bar)]
Expand Down

0 comments on commit 158b537

Please sign in to comment.