Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Add reflect(skip_serializing) which retains reflection but disables automatic serialization #5250

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove needless test
  • Loading branch information
makspll committed Sep 15, 2022
commit d7ef6d8cd0393093aaad64781abdaf639fd4c71a
24 changes: 0 additions & 24 deletions crates/bevy_reflect/src/enums/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,30 +283,6 @@ mod tests {
value.apply(&dyn_tuple);
}

#[test]
#[allow(dead_code)]
fn should_skip_ignored_variants() {
#[derive(Reflect, Debug, PartialEq)]
enum TestEnum {
A,
#[reflect(ignore)]
B,
C,
}

if let TypeInfo::Enum(info) = TestEnum::type_info() {
assert_eq!(
2,
info.variant_len(),
"expected one of the variants to be ignored"
);
assert_eq!("A", info.variant_at(0).unwrap().name());
assert_eq!("C", info.variant_at(1).unwrap().name());
} else {
panic!("expected `TypeInfo::Enum`");
}
}

#[test]
fn should_skip_ignored_fields() {
#[derive(Reflect, Debug, PartialEq)]
Expand Down