Skip to content

Commit 207589c

Browse files
committed
style: apply cargo fmt
Line-wraps the long assert_eq! calls added in Tasks 1 and 4, plus two pre-existing formatting issues in printer.rs and stream_anthropic.rs that were blocking a clean workspace-wide fmt check.
1 parent a4f3292 commit 207589c

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

crates/llm_stream/src/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ mod tests {
110110

111111
#[test]
112112
fn api_errors_show_only_the_servers_sentence() {
113-
let sentence = "The 'gpt-4o' model is not supported when using Codex with a ChatGPT account.";
113+
let sentence =
114+
"The 'gpt-4o' model is not supported when using Codex with a ChatGPT account.";
114115
let error = Error::EsStream(llm_stream::error::Error::ApiError(sentence.to_string()));
115116
assert_eq!(user_message(&error), sentence);
116117
assert!(

crates/llm_stream/src/prelude.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,10 @@ mod tests {
698698

699699
let actual = merge_args_and_config(args, config)?;
700700

701-
assert_eq!(actual.api_base_url, None, "base_url leaked across providers");
701+
assert_eq!(
702+
actual.api_base_url, None,
703+
"base_url leaked across providers"
704+
);
702705
assert_eq!(actual.model, None, "model leaked across providers");
703706
assert_eq!(actual.api_env, None, "env leaked across providers");
704707
assert_eq!(actual.api_key, None, "key leaked across providers");
@@ -775,7 +778,10 @@ mod tests {
775778
let actual = merge_args_and_config(args, config)?;
776779

777780
assert_eq!(actual.model.as_deref(), Some("o3-mini"));
778-
assert_eq!(actual.api_base_url.as_deref(), Some("https://example.test/v1"));
781+
assert_eq!(
782+
actual.api_base_url.as_deref(),
783+
Some("https://example.test/v1")
784+
);
779785

780786
Ok(())
781787
}

crates/llm_stream/src/printer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn as_24_bit_terminal_escaped(v: &[(Style, &str)], bg: bool) -> String {
7272
)
7373
.unwrap();
7474
}
75-
75+
7676
// Add font style formatting
7777
if style.font_style.contains(FontStyle::BOLD) {
7878
s.push_str("\x1b[1m");
@@ -83,10 +83,10 @@ pub fn as_24_bit_terminal_escaped(v: &[(Style, &str)], bg: bool) -> String {
8383
if style.font_style.contains(FontStyle::UNDERLINE) {
8484
s.push_str("\x1b[4m");
8585
}
86-
86+
8787
let fg = blend_fg_color(style.foreground, style.background);
8888
write!(s, "\x1b[38;2;{};{};{}m{}", fg.r, fg.g, fg.b, text).unwrap();
89-
89+
9090
// Reset only the font styles to avoid bleeding, keeping colors intact
9191
if style.font_style.contains(FontStyle::BOLD) {
9292
s.push_str("\x1b[22m"); // Reset bold

lib/llm_stream/examples/stream_anthropic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::Result;
2-
use llm_stream::anthropic::{Auth, Client, Message, MessageBody, Role};
32
use futures::stream::TryStreamExt;
3+
use llm_stream::anthropic::{Auth, Client, Message, MessageBody, Role};
44
use std::io::Write;
55

66
#[tokio::main]

0 commit comments

Comments
 (0)