diff options
| author | sigoden <sigoden@gmail.com> | 2025-08-08 06:41:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-08 06:41:21 +0800 |
| commit | cb888ef97e4123a1c27bce21ca99360e55ab1481 (patch) | |
| tree | 312bb6d05d4e15feaa3f708fb57d2e9f40fdded9 | |
| parent | cf93c2210698a5b854d58b2a3857d32a498a867d (diff) | |
| download | aichat-cb888ef97e4123a1c27bce21ca99360e55ab1481.tar.gz | |
chore: clippy with rust 1.89 (#1379)
| -rw-r--r-- | src/repl/prompt.rs | 10 | ||||
| -rw-r--r-- | src/utils/mod.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/repl/prompt.rs b/src/repl/prompt.rs index 5786b68..1264af4 100644 --- a/src/repl/prompt.rs +++ b/src/repl/prompt.rs @@ -17,26 +17,26 @@ impl ReplPrompt { } impl Prompt for ReplPrompt { - fn render_prompt_left(&self) -> Cow<str> { + fn render_prompt_left(&self) -> Cow<'_, str> { Cow::Owned(self.config.read().render_prompt_left()) } - fn render_prompt_right(&self) -> Cow<str> { + fn render_prompt_right(&self) -> Cow<'_, str> { Cow::Owned(self.config.read().render_prompt_right()) } - fn render_prompt_indicator(&self, _prompt_mode: reedline::PromptEditMode) -> Cow<str> { + fn render_prompt_indicator(&self, _prompt_mode: reedline::PromptEditMode) -> Cow<'_, str> { Cow::Borrowed("") } - fn render_prompt_multiline_indicator(&self) -> Cow<str> { + fn render_prompt_multiline_indicator(&self) -> Cow<'_, str> { Cow::Borrowed("... ") } fn render_prompt_history_search_indicator( &self, history_search: PromptHistorySearch, - ) -> Cow<str> { + ) -> Cow<'_, str> { let prefix = match history_search.status { PromptHistorySearchStatus::Passing => "", PromptHistorySearchStatus::Failing => "failing ", diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 31a05e2..e8369d8 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -88,7 +88,7 @@ pub fn estimate_token_length(text: &str) -> usize { output.ceil() as usize } -pub fn strip_think_tag(text: &str) -> Cow<str> { +pub fn strip_think_tag(text: &str) -> Cow<'_, str> { THINK_TAG_RE.replace_all(text, "") } |
