Skip to content

Commit 74bbfe4

Browse files
committed
Use r_typeof()
1 parent 0f30c00 commit 74bbfe4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/ark/src/debug.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::sync::atomic::Ordering;
44
use harp::exec::RFunction;
55
use harp::exec::RFunctionExt;
66
use harp::utils::r_str_to_owned_utf8_unchecked;
7+
use harp::utils::r_typeof;
78

89
use crate::interface::RMain;
910
use crate::interface::CAPTURE_CONSOLE_OUTPUT;
@@ -81,10 +82,10 @@ pub extern "C" fn ark_trace_back_rs() -> *const ffi::c_char {
8182
#[no_mangle]
8283
pub extern "C" fn ark_display_value_rs(x: libr::SEXP) -> *const ffi::c_char {
8384
let value = unsafe {
84-
let kind = tidy_kind(libr::TYPEOF(x) as u32);
85+
let kind = tidy_kind(r_typeof(x));
8586
let tag = format!("<{kind}>");
8687

87-
match libr::TYPEOF(x) as u32 {
88+
match r_typeof(x) {
8889
libr::SYMSXP => format!(
8990
"{tag} ({name})",
9091
name = r_str_to_owned_utf8_unchecked(libr::PRINTNAME(x))

0 commit comments

Comments
 (0)