diff options
| author | sigoden <sigoden@gmail.com> | 2024-05-22 21:37:24 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-22 21:37:24 +0800 |
| commit | 50b13d2de9c5573108f4b1c26306ad674ebb9f80 (patch) | |
| tree | 2fff9f731f526da449dd50e99663308a71e34fed /src/function.rs | |
| parent | ba3bcfd67c1d6fea5d3d3c5908c975682ee7909b (diff) | |
| download | aichat-50b13d2de9c5573108f4b1c26306ad674ebb9f80.tar.gz | |
refactor: rename `function_filter` to `function_matcher` (#535)
Diffstat (limited to 'src/function.rs')
| -rw-r--r-- | src/function.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/function.rs b/src/function.rs index f2eb0c6..a644185 100644 --- a/src/function.rs +++ b/src/function.rs @@ -126,9 +126,9 @@ impl Function { }) } - pub fn filtered_declarations(&self, filter: Option<&str>) -> Option<Vec<FunctionDeclaration>> { - let filter = filter?; - let regex = Regex::new(&format!("^({filter})$")).ok()?; + pub fn select(&self, matcher: Option<&str>) -> Option<Vec<FunctionDeclaration>> { + let matcher = matcher?; + let regex = Regex::new(&format!("^({matcher})$")).ok()?; let output: Vec<FunctionDeclaration> = self .declarations .iter() |
