Add span scope names array to capture filter data; optimize values visitor vec.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2024-08-02 22:59:14 +00:00
parent 0c6bbde25f
commit 15184d1a79
2 changed files with 23 additions and 9 deletions

View File

@@ -7,7 +7,8 @@ pub struct Data<'a> {
pub layer: &'a Layer,
pub event: &'a Event<'a>,
pub current: &'a Current,
pub values: Option<&'a mut [Value]>,
pub values: &'a [Value],
pub scope: &'a [&'static str],
}
impl Data<'_> {
@@ -23,8 +24,6 @@ impl Data<'_> {
#[must_use]
pub fn message(&self) -> &str {
self.values
.as_ref()
.expect("values are not composed for a filter")
.iter()
.find(|(k, _)| *k == "message")
.map_or("", |(_, v)| v.as_str())