We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9bc884 commit da86b05Copy full SHA for da86b05
1 file changed
ext/src/helpers/static_id.rs
@@ -22,7 +22,8 @@ pub struct StaticId(NonZeroUsize);
22
impl StaticId {
23
// Use `define_rb_intern!` instead, which uses this function.
24
pub fn intern_str(id: &'static str) -> Self {
25
- let id: Id = magnus::StaticSymbol::new(id).into();
+ let ruby = Ruby::get().unwrap();
26
+ let id: Id = ruby.sym_new(id).into();
27
28
// SAFETY: Ruby will never return a `0` ID.
29
StaticId(unsafe { NonZeroUsize::new_unchecked(id.as_raw() as _) })
@@ -39,7 +40,8 @@ impl IntoId for StaticId {
39
40
41
impl From<StaticId> for Symbol {
42
fn from(static_id: StaticId) -> Self {
- let id: Id = static_id.into_id();
43
44
+ let id: Id = static_id.into_id_with(&ruby);
45
id.into()
46
}
47
0 commit comments