Skip to content

Commit 7d85726

Browse files
lionel-DavisVaughan
andcommitted
Rename code to call
Co-authored-by: Davis Vaughan <davis@posit.co>
1 parent 4c431a6 commit 7d85726

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

crates/harp/src/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub enum Error {
2323
message: String,
2424
},
2525
TryCatchError {
26-
code: Option<String>,
26+
call: Option<String>,
2727
message: String,
2828
class: Option<Vec<String>>,
2929
r_trace: String,
@@ -98,14 +98,14 @@ impl fmt::Display for Error {
9898
},
9999

100100
Error::TryCatchError {
101-
code,
101+
call,
102102
message,
103103
r_trace,
104104
rust_trace,
105105
..
106106
} => {
107-
if let Some(code) = code {
108-
let code = truncate_lines(code.to_owned(), 50);
107+
if let Some(call) = call {
108+
let code = truncate_lines(call.to_owned(), 50);
109109
write!(f, "Error evaluating '{code}': {message}")?;
110110
} else {
111111
write!(f, "{message}")?;

crates/harp/src/exec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ impl RFunction {
9595
pub fn try_eval(expr: SEXP, env: SEXP) -> crate::Result<RObject> {
9696
let mut res = try_catch(|| unsafe { Rf_eval(expr, env) }).map(RObject::from);
9797

98-
if let Err(Error::TryCatchError { ref mut code, .. }) = res {
99-
*code = Some(unsafe { r_stringify(expr, "\n")? });
98+
if let Err(Error::TryCatchError { ref mut call, .. }) = res {
99+
*call = Some(unsafe { r_stringify(expr, "\n")? });
100100
}
101101

102102
res
@@ -237,7 +237,7 @@ where
237237
let rust_trace = std::backtrace::Backtrace::force_capture();
238238

239239
*(data.res) = Some(Err(Error::TryCatchError {
240-
code: call,
240+
call,
241241
message,
242242
class,
243243
r_trace,

0 commit comments

Comments
 (0)