From cbdee48b25284bdf971c0a1aa22e0d526d6ca7d5 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sat, 21 Mar 2026 23:55:10 +0000 Subject: [PATCH] refactor: drop OptionalContext marker --- --- a/crates/jrsonnet-evaluator/src/function/arglike.rs +++ b/crates/jrsonnet-evaluator/src/function/arglike.rs @@ -7,9 +7,6 @@ use crate::{evaluate, typed::Typed, with_state, Context, Result, Thunk, Val}; -/// Marker for arguments, which can be evaluated with context set to None -pub trait OptionalContext {} - pub trait ArgLike { fn evaluate_arg(&self, ctx: Context, tailstrict: bool) -> Result>; } @@ -37,7 +34,6 @@ Ok(Thunk::evaluated(val)) } } -impl OptionalContext for T where T: Typed + Clone {} #[derive(Clone, Trace)] pub enum TlaArg { @@ -248,7 +244,6 @@ self.is_empty() } } -impl OptionalContext for HashMap where V: ArgLike + OptionalContext {} macro_rules! impl_args_like { ($count:expr; $($gen:ident)*) => { @@ -286,7 +281,6 @@ false } } - impl<$($gen: ArgLike,)*> OptionalContext for ($($gen,)*) where $($gen: OptionalContext),* {} }; ($count:expr; $($cur:ident)* @ $c:ident $($rest:ident)*) => { impl_args_like!($count; $($cur)*); @@ -329,4 +323,3 @@ true } } -impl OptionalContext for () {} -- gitstuff