fix StorePath not using ToNixideResult

This commit is contained in:
do butterflies cry? 2026-04-14 10:09:24 +10:00
parent 6159645bf8
commit 075c315fe7
Signed by: cry
GPG key ID: F68745A836CA0412

View file

@ -6,7 +6,7 @@ use std::rc::Rc;
use super::Store;
use crate::NixideResult;
use crate::errors::{ErrorContext, new_nixide_error};
use crate::errors::{ErrorContext, ToNixideResult as _, new_nixide_error};
use crate::stdext::CCharPtrExt as _;
use crate::sys;
use crate::util::panic_issue_call_failed;
@ -85,7 +85,7 @@ impl StorePath {
/// ```
///
pub fn new(store: Rc<RefCell<Store>>, path: &str) -> NixideResult<Self> {
let c_path = CString::new(path).or(Err(new_nixide_error!(StringNulByte)))?;
let c_path = CString::new(path).to_nixide_result()?;
let inner = wrap::nix_ptr_fn!(|ctx: &ErrorContext| unsafe {
sys::nix_store_parse_path(ctx.as_ptr(), store.borrow().as_ptr(), c_path.as_ptr())