Skip to main content

scopes_meet

Function scopes_meet 

Source
pub fn scopes_meet(a: &[String], b: &[String]) -> bool
Expand description

Whether any path of one scope meets any path of the other. Paths meet by crate::peers::claims_meet, the peer board’s own predicate, so that a claim means the same thing on this machine and on another: a directory contains what is under it, and two claims that share no path do not meet however similar they look.

use majordomus_cli::mesh::state::scopes_meet;

assert!(scopes_meet(&["apps".into()], &["apps/majordomus-cli/src".into()]), "a tree contains it");
assert!(!scopes_meet(&["apps".into()], &["docs".into()]));
assert!(!scopes_meet(&[], &["apps".into()]), "a claim over nothing meets nothing");