diff options
| author | Sébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com> | 2023-04-23 14:33:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-23 14:33:56 +0200 |
| commit | 561ff979d574f496415c0499345d41da2e1f6e1e (patch) | |
| tree | 037479ac000bd87a1cb2149e5389b28f08d24051 /src/model/styles.rs | |
| parent | 2fbb14f712708188649181525813b3ac5a02e0fb (diff) | |
Add instrumentation (Part 1) (#761)
Diffstat (limited to 'src/model/styles.rs')
| -rw-r--r-- | src/model/styles.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/model/styles.rs b/src/model/styles.rs index 8b7a829f..9ef74276 100644 --- a/src/model/styles.rs +++ b/src/model/styles.rs @@ -360,7 +360,7 @@ impl Selector { Self::Before { selector, end: location, inclusive } => { if let Some(content) = introspector.query_first(location) { let loc = content.location().unwrap(); - Box::new(selector.match_iter_inner(introspector, parent).filter( + Box::new(selector.match_iter_inner(introspector, parent).take_while( move |elem| { introspector.is_before( elem.location().unwrap(), @@ -376,12 +376,12 @@ impl Selector { Self::After { selector, start: location, inclusive } => { if let Some(content) = introspector.query_first(location) { let loc = content.location().unwrap(); - Box::new(selector.match_iter_inner(introspector, parent).filter( + Box::new(selector.match_iter_inner(introspector, parent).skip_while( move |elem| { - introspector.is_after( + introspector.is_before( elem.location().unwrap(), loc, - *inclusive, + !*inclusive, ) }, )) @@ -586,6 +586,7 @@ impl<'a> StyleChain<'a> { /// The resulting style chain contains styles from `local` as well as /// `self`. The ones from `local` take precedence over the ones from /// `self`. For folded properties `local` contributes the inner value. + #[tracing::instrument(skip_all)] pub fn chain<'b>(&'b self, local: &'b Styles) -> StyleChain<'b> { if local.is_empty() { *self @@ -595,6 +596,7 @@ impl<'a> StyleChain<'a> { } /// Cast the first value for the given property in the chain. + #[tracing::instrument(skip_all)] pub fn get<T: Cast>( self, func: ElemFunc, @@ -608,6 +610,7 @@ impl<'a> StyleChain<'a> { } /// Cast the first value for the given property in the chain. + #[tracing::instrument(skip_all)] pub fn get_resolve<T: Cast + Resolve>( self, func: ElemFunc, @@ -619,6 +622,7 @@ impl<'a> StyleChain<'a> { } /// Cast the first value for the given property in the chain. + #[tracing::instrument(skip_all)] pub fn get_fold<T: Cast + Fold>( self, func: ElemFunc, @@ -640,6 +644,7 @@ impl<'a> StyleChain<'a> { } /// Cast the first value for the given property in the chain. + #[tracing::instrument(skip_all)] pub fn get_resolve_fold<T>( self, func: ElemFunc, @@ -674,6 +679,7 @@ impl<'a> StyleChain<'a> { } /// Iterate over all values for the given property in the chain. + #[tracing::instrument(skip_all)] pub fn properties<T: Cast + 'a>( self, func: ElemFunc, |
