Skip to content

chore: apply cargo fmt across the workspace#68

Merged
BunsDev merged 1 commit into
mainfrom
chore/cargo-fmt
May 19, 2026
Merged

chore: apply cargo fmt across the workspace#68
BunsDev merged 1 commit into
mainfrom
chore/cargo-fmt

Conversation

@BunsDev
Copy link
Copy Markdown
Member

@BunsDev BunsDev commented May 19, 2026

Summary

cargo fmt --check --all surfaced 85 rustfmt deviations across 31 .rs files. Applied via cargo fmt --all.

Net +562 / −496 lines, all formatting. No semantic changes.

Where the diff lives

  • crates/create_markdown_core/src/parsers/ — re-wraps of long match arms (inline.rs, markdown.rs, tokenizer.rs) plus serializers/markdown.rs
  • crates/warpui_core/src/elements/ — minor brace placement in event_handler.rs, hoverable.rs, text.rs
  • app/src/ — collapse of multi-line method chains that fit, split of others past the line-width limit (bin/oss.rs, ai_assistant/panel.rs, etc.)
  • A handful in crates/ai/, crates/warp_completer/, crates/cast_agent/

Test plan

  • cargo check --workspace --all-targets — clean, 0 errors
  • cargo fmt --check --all would now exit 0 against this branch
  • CI green on this PR

🤖 Generated with Claude Code

85 rustfmt deviations across 31 .rs files. Mechanical reformat;
no semantic changes. `cargo check --workspace --all-targets` clean.

Net +562 / -496 lines, mostly:
- inline.rs / markdown.rs (create_markdown_core parser): re-wrap of
  long match arms
- warp-app: collapse of some multi-line method chains, split of
  others that crossed the line-width limit
- warpui_core elements: minor brace placement

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 19, 2026 02:20
@BunsDev BunsDev merged commit 7d6e700 into main May 19, 2026
10 checks passed
@BunsDev BunsDev deleted the chore/cargo-fmt branch May 19, 2026 02:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Applies cargo fmt --all across the Rust workspace to resolve rustfmt deviations and normalize formatting (match guards, method chaining, import ordering, and line wrapping) throughout core crates and the app UI code.

Changes:

  • Workspace-wide rustfmt reformatting across parsing/serialization, UI elements, and app views.
  • Rewrapped long expressions/match guards and normalized import/group ordering.
  • Reformatted and reorganized several test blocks and helper functions for consistent style.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/warpui_core/src/elements/text.rs rustfmt rewrap of match arm + guard formatting.
crates/warpui_core/src/elements/hoverable.rs rustfmt rewrap of event match guards/arms.
crates/warpui_core/src/elements/event_handler.rs rustfmt rewrap of guarded match arms and long call formatting.
crates/warp_completer/src/completer/engine/argument/legacy.rs rustfmt rewrap of match arm + guard with iterator chain.
crates/create_markdown_core/src/utils.rs rustfmt line wrapping and brace/guard formatting.
crates/create_markdown_core/src/serializers/markdown.rs rustfmt rewraps; test formatting adjustments.
crates/create_markdown_core/src/parsers/tokenizer.rs rustfmt wrapping of long expressions/guards and conditionals.
crates/create_markdown_core/src/parsers/markdown.rs rustfmt import ordering and test formatting.
crates/create_markdown_core/src/parsers/inline.rs rustfmt wrapping of chained if let guards and returns.
crates/create_markdown_core/src/lib.rs rustfmt reorder/rewrap of pub use exports.
crates/create_markdown_core/src/document.rs rustfmt wrapping and conditional formatting; test section formatting.
crates/create_markdown_core/src/blocks.rs rustfmt wrapping for signatures/iterators and test assertions.
crates/cast_agent/tests/substrate.rs rustfmt method-chain wrapping in tests.
crates/cast_agent/src/runtime.rs rustfmt rewrap of OnceLock init closure and call chains.
crates/cast_agent/src/gateway.rs rustfmt line wrapping for URL formatting and type alias.
app/src/workspace/view.rs rustfmt indentation/chain wrapping in workspace view logic.
app/src/workspace/mod.rs rustfmt reorder of use items with cfg gating.
app/src/terminal/cli_agent_sessions/listener/mod.rs rustfmt import and method-chain wrapping.
app/src/code/cast_agent_diagnostics.rs rustfmt wrapping of match/iterator chains and method calls.
app/src/cli_chat/view/transcript.rs rustfmt wrapping of match alternatives for bindings.
app/src/cli_chat/view/model_picker.rs rustfmt chain wrapping and match alternative formatting.
app/src/cli_chat/view/mod.rs rustfmt wrapping of subscribe_to_model and placeholder setter.
app/src/cli_chat/view/message_bubble.rs rustfmt wrapping of helper signatures and calls.
app/src/cli_chat/view/error_banner.rs rustfmt chain wrapping.
app/src/cli_chat/view/empty_state.rs rustfmt tuple formatting in match arms.
app/src/cli_chat/strings.rs rustfmt line wrapping for long string constant.
app/src/cli_chat/store_tests.rs rustfmt enum struct literal formatting.
app/src/cli_chat/store_schema_tests.rs rustfmt closure formatting in query call.
app/src/cli_chat/model.rs rustfmt function signature wrapping.
app/src/bin/oss.rs rustfmt method-chain wrapping.
app/src/ai_assistant/panel.rs rustfmt chain wrapping and closure formatting.
Comments suppressed due to low confidence (1)

crates/create_markdown_core/src/serializers/markdown.rs:621

  • These #[test] functions are outside the #[cfg(test)] mod tests block, so they will be compiled into non-test builds as regular private functions (and may trigger dead_code warnings / increase build time). Move them into the existing tests module or add #[cfg(test)] to each test.
#[test]
fn code_block_with_backtick_fence_is_escaped() {
    use crate::blocks::code_block as mkcode;
    let block = mkcode("```js\nconsole.log(1)\n```", Some("md".to_string()));
    let siblings = [block.clone()];

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +601 to +605
// ── new tests for fixed behaviours ─────────────────────────────────────

#[test]
fn image_with_title_round_trips() {
let blocks = parse(r#"![logo](https://example.com/logo.png "Brand Logo")"#);
Comment on lines +639 to +643
// ── new tests for fixed behaviours ─────────────────────────────────────

#[test]
fn create_document_with_generate_id_uses_custom_ids() {
use std::sync::{Arc, Mutex};
use crate::blocks::paragraph;

let counter = Arc::new(Mutex::new(0u32));
let counter_clone = counter.clone();
let options = DocumentOptions {
generate_id: Some(Arc::new(move || {
let mut c = counter_clone.lock().unwrap();
*c += 1;
format!("custom-{}", *c)
})),
meta: None,
};
let blocks = vec![paragraph("hello"), paragraph("world")];
let doc = create_document(&blocks, options);
assert_eq!(doc.blocks[0].id, "custom-1");
assert_eq!(doc.blocks[1].id, "custom-2");
}
#[test]
fn create_document_with_generate_id_uses_custom_ids() {
use crate::blocks::paragraph;
Comment on lines 508 to 514
fn image_with_and_without_title() {
let no_title = image(
"https://x",
Some("alt".into()),
ImageOptions::default(),
let no_title = image("https://x", Some("alt".into()), ImageOptions::default());
assert_eq!(
blocks_to_markdown(&[no_title], &opts()),
"![alt](https://x)"
);
assert_eq!(blocks_to_markdown(&[no_title], &opts()), "![alt](https://x)");
let with_title = image(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants