fix EvalStateBuilderExt
This commit is contained in:
parent
3ebb96db63
commit
3cdfae01b9
1 changed files with 8 additions and 11 deletions
|
|
@ -1,17 +1,14 @@
|
|||
use super::FlakeSettings;
|
||||
use crate::{EvalStateBuilder, NixErrorCode};
|
||||
|
||||
pub trait EvalStateBuilderExt {
|
||||
/// Configures the eval state to provide flakes features such as `builtins.getFlake`.
|
||||
fn flakes(
|
||||
self,
|
||||
settings: &FlakeSettings,
|
||||
) -> Result<nix_bindings_expr::eval_state::EvalStateBuilder>;
|
||||
fn flakes(self, settings: &FlakeSettings) -> Result<EvalStateBuilder, NixErrorCode>;
|
||||
}
|
||||
impl EvalStateBuilderExt for nix_bindings_expr::eval_state::EvalStateBuilder {
|
||||
|
||||
impl EvalStateBuilderExt for EvalStateBuilder {
|
||||
/// Configures the eval state to provide flakes features such as `builtins.getFlake`.
|
||||
fn flakes(
|
||||
mut self,
|
||||
settings: &FlakeSettings,
|
||||
) -> Result<nix_bindings_expr::eval_state::EvalStateBuilder> {
|
||||
settings.add_to_eval_state_builder(&mut self)?;
|
||||
Ok(self)
|
||||
fn flakes(mut self, settings: &FlakeSettings) -> Result<EvalStateBuilder, NixErrorCode> {
|
||||
settings.add_to_eval_state_builder(&mut self).map(|_| self)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue