diff --git a/nixide/src/expr/realised_string.rs b/nixide/src/expr/realised_string.rs index 8cf08a4..5e10470 100644 --- a/nixide/src/expr/realised_string.rs +++ b/nixide/src/expr/realised_string.rs @@ -1,6 +1,7 @@ use std::cell::RefCell; use std::ffi::c_char; use std::ptr::NonNull; +use std::rc::Rc; use crate::errors::ErrorContext; use crate::expr::values::NixString; @@ -74,15 +75,18 @@ impl<'a> RealisedString<'a> { Ok(Self { inner: RefCell::new(inner), - path: Self::parse_path(inner.as_ptr(), &state.store_ref().borrow()), + path: Self::parse_path(inner.as_ptr(), state.store_ref().clone()), children: LazyArray::new( size, - Box::new(|_| StorePath::fake_path(&state.store_ref().borrow()).unwrap()), + Box::new(|_| StorePath::fake_path(state.store_ref().clone()).unwrap()), ), }) } - fn parse_path(realised_string: *mut sys::NixRealisedString, store: &Store) -> StorePath { + fn parse_path( + realised_string: *mut sys::NixRealisedString, + store: Rc>, + ) -> StorePath { let buffer_ptr = unsafe { sys::nix_realised_string_get_buffer_start(realised_string) }; let buffer_size = unsafe { sys::nix_realised_string_get_buffer_size(realised_string) };