MCPcopy Create free account
hub / github.com/ccusage/ccusage / matches

Method matches

rust/crates/ccusage/src/fast.rs:59–70  ·  view source on GitHub ↗

Return `true` when `line` passes the filter and is worth parsing.

(&self, line: &[u8])

Source from the content-addressed store, hash-verified

57
58 /// Return `true` when `line` passes the filter and is worth parsing.
59 pub(crate) fn matches(&self, line: &[u8]) -> bool {
60 match self.mode {
61 PrefilterMode::All => self
62 .finders
63 .iter()
64 .all(|finder| finder.find(line).is_some()),
65 PrefilterMode::Any => self
66 .finders
67 .iter()
68 .any(|finder| finder.find(line).is_some()),
69 }
70 }
71}
72
73pub(crate) struct ByteLines<'a> {

Callers 1

recordsFunction · 0.80

Calls 3

allMethod · 0.80
findMethod · 0.80
anyMethod · 0.80

Tested by

no test coverage detected