MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / matches_prefix

Method matches_prefix

atomic-core/src/record/workflow/options.rs:320–325  ·  view source on GitHub ↗

Check if a path matches the prefix filter. # Arguments `path` - Path to check # Returns `true` if the path matches (or prefix is empty). # Example ```rust use atomic_core::record::workflow::WorkflowOptions; let opts = WorkflowOptions::new().with_prefix("src/"); assert!(opts.matches_prefix("src/main.rs")); assert!(opts.matches_prefix("src/lib/mod.rs")); assert!(!opts.matches_prefix("tests/t

(&self, path: &str)

Source from the content-addressed store, hash-verified

318 /// assert!(opts.matches_prefix("anything"));
319 /// ```
320 pub fn matches_prefix(&self, path: &str) -> bool {
321 if self.prefix.is_empty() {
322 return true;
323 }
324 path.starts_with(&self.prefix)
325 }
326
327 /// Check if a file size exceeds the maximum for diffing.
328 ///

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected