fix Rc<RefCell<Store>> issues
This commit is contained in:
parent
8aebcdda5a
commit
ecd88cd4c1
1 changed files with 7 additions and 3 deletions
|
|
@ -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<RefCell<Store>>,
|
||||
) -> 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) };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue