Fix more bare dyn traits in runtime-c-api

This commit is contained in:
Brandon Fish
2019-08-10 11:20:22 -06:00
parent d23e5eb18c
commit 6372e0947c

View File

@ -8,7 +8,7 @@ use std::ptr;
use std::slice; use std::slice;
thread_local! { thread_local! {
static LAST_ERROR: RefCell<Option<Box<Error>>> = RefCell::new(None); static LAST_ERROR: RefCell<Option<Box<dyn Error>>> = RefCell::new(None);
} }
pub fn update_last_error<E: Error + 'static>(err: E) { pub fn update_last_error<E: Error + 'static>(err: E) {
@ -18,7 +18,7 @@ pub fn update_last_error<E: Error + 'static>(err: E) {
} }
/// Retrieve the most recent error, clearing it in the process. /// Retrieve the most recent error, clearing it in the process.
pub(crate) fn take_last_error() -> Option<Box<Error>> { pub(crate) fn take_last_error() -> Option<Box<dyn Error>> {
LAST_ERROR.with(|prev| prev.borrow_mut().take()) LAST_ERROR.with(|prev| prev.borrow_mut().take())
} }