Skip to content

Commit

Permalink
fix Time on Ruby 3.3.0-dev
Browse files Browse the repository at this point in the history
wrapped structs can now be embedded in their wrapping object, and
Time takes advantage of this. This means `typed_flag` is no longer
always 1
  • Loading branch information
matsadler committed Dec 2, 2023
1 parent 2708b9a commit d7eab0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/r_typed_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ impl RTypedData {
(val.rb_type() == ruby_value_type::RUBY_T_DATA)
.then(|| NonNull::new_unchecked(val.as_rb_value() as *mut rb_sys::RTypedData))
.and_then(|typed_data| {
(typed_data.as_ref().typed_flag == 1)
let typed_flag = typed_data.as_ref().typed_flag;
(typed_flag != 0 && typed_flag <= 3)
.then(|| Self(NonZeroValue::new_unchecked(val)))
})
}
Expand Down

0 comments on commit d7eab0e

Please sign in to comment.