From 172e71a5fa87632af70d351de1b2a439a6fe9498 Mon Sep 17 00:00:00 2001 From: Justin Barclay Date: Thu, 12 Sep 2024 14:18:34 -0700 Subject: [PATCH] fix: remove wrapping error object in RefCell --- Cargo.toml | 2 +- src/emacs_wrapper.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 48e2908..c2a01ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "parinfer_rust" -version = "0.4.6" +version = "0.4.7" authors = ["Jason Felice "] [lib] diff --git a/src/emacs_wrapper.rs b/src/emacs_wrapper.rs index 38ebe3c..6041bc1 100644 --- a/src/emacs_wrapper.rs +++ b/src/emacs_wrapper.rs @@ -4,7 +4,7 @@ use super::parinfer::rc_process; use emacs::{Env, FromLisp, IntoLisp, Result, Value}; use types::{Change, Error, Options, Request, SharedRequest, WrappedAnswer}; -use std::{cell::RefCell, convert::TryFrom, fs::OpenOptions, io::Write, rc::Rc}; +use std::{convert::TryFrom, fs::OpenOptions, io::Write, rc::Rc}; emacs::plugin_is_GPL_compatible!(); @@ -643,7 +643,7 @@ fn get_answer<'a>(env: &'a Env, answer: &WrappedAnswer, key: AnswerKey) -> Resul AnswerKey::Text => unwrapped_answer.text.to_string().into_lisp(env), AnswerKey::Success => unwrapped_answer.success.into_lisp(env), AnswerKey::Error => match unwrapped_answer.error.clone() { - Some(error) => Ok(RefCell::new(error).into_lisp(env)?), + Some(error) => Ok(error.into_lisp(env)?), None => ().into_lisp(env), }, AnswerKey::CursorX => to_i64(unwrapped_answer.cursor_x).into_lisp(env),