Skip to content

Commit

Permalink
Remove possibly problematic impl Into<SEXP>.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalbel committed Nov 27, 2024
1 parent 15b9759 commit 9aa5d05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/harp/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ impl Environment {
std::iter::successors(Some(self.clone()), |p| p.parent())
}

pub fn bind(&self, name: RSymbol, value: impl Into<SEXP>) {
pub fn bind(&self, name: RSymbol, value: SEXP) {
unsafe {
Rf_defineVar(name.sexp, value.into(), self.inner.sexp);
}
}

pub fn force_bind(&self, name: RSymbol, value: impl Into<SEXP>) {
pub fn force_bind(&self, name: RSymbol, value: SEXP) {
let locked = self.is_locked_binding(name);
if locked {
self.unlock_binding(name);
Expand Down
6 changes: 3 additions & 3 deletions crates/harp/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ pub fn save_rds(x: SEXP, path: &str) {

let env = Environment::new(harp::parse_eval_base("new.env()").unwrap());
env.bind("x".into(), x);
env.bind("path".into(), path);
env.bind("path".into(), path.sexp);

let res = harp::parse_eval0("base::saveRDS(x, path)", env);

Expand Down Expand Up @@ -702,8 +702,8 @@ pub fn push_rds(x: SEXP, path: &str, context: &str) {
let env = Environment::new(harp::parse_eval_base("new.env()").unwrap());

env.bind("x".into(), x);
env.bind("path".into(), path);
env.bind("context".into(), context);
env.bind("path".into(), path.sexp);
env.bind("context".into(), context.sexp);

let res = harp::parse_eval0(".ps.internal(push_rds(x, path, context))", env);

Expand Down

0 comments on commit 9aa5d05

Please sign in to comment.