From 64840fbbaefcfe32601716e8325c5d354e17bdb5 Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu, 2 Nov 2023 20:21:07 +0800 Subject: [PATCH] `join_segments` -> `build_glob_string` - this is a more descriptive name --- build/syntax_mapping.rs | 2 +- src/syntax_mapping.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/syntax_mapping.rs b/build/syntax_mapping.rs index 217a1fea..c5efadc4 100644 --- a/build/syntax_mapping.rs +++ b/build/syntax_mapping.rs @@ -138,7 +138,7 @@ impl Matcher { // parser logic ensures that this case can only happen when there are dynamic segments _ => { let segments_codegen = self.0.iter().map(MatcherSegment::codegen).join(", "); - let closure = format!("|| join_segments(&[{segments_codegen}])"); + let closure = format!("|| build_glob_string(&[{segments_codegen}])"); format!("BuiltinMatcher::Dynamic(Lazy::new({closure}))") } } diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs index f3c6c0ab..2b003a3d 100644 --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -42,11 +42,11 @@ impl BuiltinMatcher { } } -/// Join a list of matcher segments, replacing all environment variables. -/// Returns `None` if any replacement fails. +/// Join a list of matcher segments to create a glob string, replacing all +/// environment variables. Returns `None` if any replacement fails. /// /// Used internally by `BuiltinMatcher::Dynamic`'s lazy evaluation closure. -fn join_segments(segs: &[MatcherSegment]) -> Option { +fn build_glob_string(segs: &[MatcherSegment]) -> Option { let mut buf = String::new(); for seg in segs { match seg {