1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/// Creates a [`globset::Glob`] from a string literal, panicking if the
/// pattern is invalid.
///
/// Intended for use with constant patterns where an invalid glob is a bug.
///
/// # Examples
///
/// ```rust
/// use loadsmith_loader::glob;
///
/// let g = glob!("version.dll");
/// let matcher = g.compile_matcher();
/// assert!(matcher.is_match("version.dll"));
/// assert!(!matcher.is_match("winmm.dll"));
/// ```
/// Creates a [`loadsmith_install::GlobRule`] from a pattern and destination
/// path literal, panicking if the pattern is invalid.
///
/// # Examples
///
/// ```rust
/// use loadsmith_loader::glob_rule;
/// use loadsmith_install::GlobRule;
///
/// let rule: GlobRule = glob_rule!("*.dll" => "plugins");
/// assert!(rule.matches("mod.dll"));
/// assert!(!rule.matches("mod.txt"));
/// ```