Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Fix extern static warning
Browse files Browse the repository at this point in the history
  • Loading branch information
chancancode committed Feb 16, 2017
1 parent 7ecd973 commit 1806d4d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/coercions/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl UncheckedValue<bool> for VALUE {

impl ToRust<bool> for CheckedValue<bool> {
fn to_rust(self) -> bool {
if self.inner == Qtrue {
if self.inner == unsafe { Qtrue } {
true
} else {
false
Expand All @@ -26,9 +26,9 @@ impl ToRust<bool> for CheckedValue<bool> {
impl ToRuby for bool {
fn to_ruby(self) -> VALUE {
if self {
Qtrue
unsafe { Qtrue }
} else {
Qfalse
unsafe { Qfalse }
}
}
}
}
4 changes: 2 additions & 2 deletions src/coercions/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ use ToRuby;

impl ToRuby for () {
fn to_ruby(self) -> VALUE {
sys::Qnil
unsafe { sys::Qnil }
}
}
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl RubyMethod for extern "C" fn(VALUE, VALUE) -> VALUE {
#[allow(non_snake_case)]
#[inline]
fn ObjectClass() -> Class {
Class(sys::rb_cObject)
Class(unsafe { sys::rb_cObject })
}

impl Class {
Expand Down
4 changes: 2 additions & 2 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ macro_rules! class_definition {
let checked = __checked_call__(rb_self, $($arg),*);
match checked {
Ok(val) => $crate::ToRuby::to_ruby(val),
Err(err) => { println!("TYPE ERROR: {:?}", err); $crate::sys::Qnil }
Err(err) => { println!("TYPE ERROR: {:?}", err); unsafe { $crate::sys::Qnil } }
}
}

Expand Down Expand Up @@ -137,7 +137,7 @@ macro_rules! reopen_class_definition {
let checked = __checked_call__(rb_self, $($arg),*);
match checked {
Ok(val) => $crate::ToRuby::to_ruby(val),
Err(err) => { println!("TYPE ERROR: {:?}", err); $crate::sys::Qnil }
Err(err) => { println!("TYPE ERROR: {:?}", err); unsafe { $crate::sys::Qnil } }
}
}

Expand Down

0 comments on commit 1806d4d

Please sign in to comment.