Skip to content

Commit 104b0b4

Browse files
committed
fix: 修复模型提供商未返回stop word本身,导致错误的bug
Signed-off-by: jinlong <fslongjin@vip.qq.com>
1 parent fd47e5c commit 104b0b4

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fastcommit"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "AI-based command line tool to quickly generate standardized commit messages."
55
edition = "2021"
66
authors = ["longjin <fslongjin@vip.qq.com>"]

src/generate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ fn extract_commit_message(response: &str) -> anyhow::Result<String> {
7676
.ok_or(anyhow::anyhow!("Start tag <aicommit> not found"))?
7777
+ start_tag.len();
7878
let end_idx = response
79-
.find(end_tag)
80-
.ok_or(anyhow::anyhow!("End tag </aicommit> not found"))?;
79+
.find(end_tag).unwrap_or_else(|| response.len());
8180

8281
let commit_message = response[start_idx..end_idx].trim().to_string();
8382
Ok(commit_message)

0 commit comments

Comments
 (0)