chore: apply cargo fmt across the workspace#68
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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 testsblock, 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 existingtestsmodule 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#""#); |
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()), | ||
| "" | ||
| ); | ||
| assert_eq!(blocks_to_markdown(&[no_title], &opts()), ""); | ||
| let with_title = image( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo fmt --check --allsurfaced 85 rustfmt deviations across 31.rsfiles. Applied viacargo 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) plusserializers/markdown.rscrates/warpui_core/src/elements/— minor brace placement inevent_handler.rs,hoverable.rs,text.rsapp/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.)crates/ai/,crates/warp_completer/,crates/cast_agent/Test plan
cargo check --workspace --all-targets— clean, 0 errorscargo fmt --check --allwould now exit 0 against this branch🤖 Generated with Claude Code