Document another rule ignore condition

This commit is contained in:
cyqsimon 2023-11-05 22:46:53 +08:00
parent 12fa2cb1eb
commit 36073a3d95
No known key found for this signature in database
GPG Key ID: 1D8CE2F297390D65
2 changed files with 8 additions and 6 deletions

View File

@ -61,9 +61,8 @@ impl<'a> SyntaxMapping<'a> {
///
/// Builtin mappings' `GlobMatcher`s are lazily compiled.
///
/// Note that this function ignores builtin mappings that are invalid under
/// the current environment (i.e. their rules require an environment
/// variable that is unset).
/// Note that this function only returns mappings that are valid under the
/// current environment. For details see [`Self::builtin_mappings`].
pub fn all_mappings(&self) -> impl Iterator<Item = (&GlobMatcher, &MappingTarget<'a>)> {
self.custom_mappings()
.iter()
@ -83,8 +82,10 @@ impl<'a> SyntaxMapping<'a> {
///
/// The `GlabMatcher`s are lazily compiled.
///
/// If a mapping rule requires an environment variable that is unset, it
/// will be ignored.
/// Mappings that are invalid under the current environment (i.e. rule
/// requires environment variable(s) that is unset, or the joined string
/// after variable(s) replacement is not a valid glob expression) are
/// ignored.
pub fn builtin_mappings(
&self,
) -> impl Iterator<Item = (&'static GlobMatcher, &'static MappingTarget<'static>)> {

View File

@ -76,7 +76,8 @@ could write something like this:
```
If any environment variable replacement in a rule fails (for example when a
variable is unset), the entire rule will be ignored.
variable is unset), or if the glob string after replacements is invalid, the
entire rule will be ignored.
### Explicitly mapping to unknown