Skip to content

Commit 4a85405

Browse files
Mike Morganclaude
andcommitted
style: Apply rustfmt to all source files
Fixes CI rustfmt check failures. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8b71620 commit 4a85405

50 files changed

Lines changed: 1226 additions & 770 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/src/lua.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ pub fn make_lua_context(config_file: &Path) -> anyhow::Result<Lua> {
222222
let package: Table = globals.get("package").context("get _G.package")?;
223223
let loaded: Table = package.get("loaded").context("get package.loaded")?;
224224
// CX Terminal: Create 'cx' as an alias to 'wezterm' for CX users
225-
loaded.set("cx", wezterm_mod.clone()).context("set cx alias")?;
225+
loaded
226+
.set("cx", wezterm_mod.clone())
227+
.context("set cx alias")?;
226228

227229
let package_path: String = package.get("path").context("get package.path as String")?;
228230
let mut path_array: Vec<String> = package_path.split(";").map(|s| s.to_owned()).collect();
@@ -336,10 +338,10 @@ end
336338

337339
// CX Terminal: AI integration module
338340
let ai_mod = lua.create_table()?;
339-
ai_mod.set("enabled", false)?; // AI disabled by default, enable in config
340-
ai_mod.set("provider", "none")?; // AI provider: "claude", "openai", "local", "none"
341-
ai_mod.set("model", "")?; // Model name if applicable
342-
ai_mod.set("api_endpoint", "")?; // Custom API endpoint
341+
ai_mod.set("enabled", false)?; // AI disabled by default, enable in config
342+
ai_mod.set("provider", "none")?; // AI provider: "claude", "openai", "local", "none"
343+
ai_mod.set("model", "")?; // Model name if applicable
344+
ai_mod.set("api_endpoint", "")?; // Custom API endpoint
343345
wezterm_mod.set("ai", ai_mod)?;
344346
wezterm_mod.set(
345347
"running_under_wsl",

term/src/terminalstate/performer.rs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -315,26 +315,25 @@ impl<'a> Performer<'a> {
315315

316316
if params.contains_key("start") {
317317
let command = params.get("cmd").map(|s| s.to_string()).unwrap_or_default();
318-
let timestamp = params.get("time")
319-
.and_then(|t| t.parse().ok())
320-
.unwrap_or(0);
318+
let timestamp = params.get("time").and_then(|t| t.parse().ok()).unwrap_or(0);
321319
handler.alert(Alert::CXBlockStart { command, timestamp });
322320
} else if params.contains_key("end") {
323-
let exit_code = params.get("exit")
324-
.and_then(|e| e.parse().ok())
325-
.unwrap_or(0);
326-
let timestamp = params.get("time")
327-
.and_then(|t| t.parse().ok())
328-
.unwrap_or(0);
329-
handler.alert(Alert::CXBlockEnd { exit_code, timestamp });
321+
let exit_code = params.get("exit").and_then(|e| e.parse().ok()).unwrap_or(0);
322+
let timestamp = params.get("time").and_then(|t| t.parse().ok()).unwrap_or(0);
323+
handler.alert(Alert::CXBlockEnd {
324+
exit_code,
325+
timestamp,
326+
});
330327
}
331328
}
332329

333330
fn parse_cx_cwd(parts: &[&str], handler: &mut dyn crate::terminal::AlertHandler) {
334331
for part in parts {
335332
if let Some((key, value)) = part.split_once('=') {
336333
if key == "path" {
337-
handler.alert(Alert::CXCwdChanged { path: value.to_string() });
334+
handler.alert(Alert::CXCwdChanged {
335+
path: value.to_string(),
336+
});
338337
return;
339338
}
340339
}
@@ -346,11 +345,15 @@ impl<'a> Performer<'a> {
346345
if let Some((key, value)) = part.split_once('=') {
347346
match key {
348347
"explain" | "text" => {
349-
handler.alert(Alert::CXAIExplain { text: value.to_string() });
348+
handler.alert(Alert::CXAIExplain {
349+
text: value.to_string(),
350+
});
350351
return;
351352
}
352353
"suggest" | "query" => {
353-
handler.alert(Alert::CXAISuggest { query: value.to_string() });
354+
handler.alert(Alert::CXAISuggest {
355+
query: value.to_string(),
356+
});
354357
return;
355358
}
356359
_ => {}
@@ -370,7 +373,10 @@ impl<'a> Performer<'a> {
370373
}
371374

372375
if let Some(name) = params.get("name") {
373-
let command = params.get("command").map(|s| s.to_string()).unwrap_or_default();
376+
let command = params
377+
.get("command")
378+
.map(|s| s.to_string())
379+
.unwrap_or_default();
374380
handler.alert(Alert::CXAgentRequest {
375381
name: name.to_string(),
376382
command,

testsprite_tests/tmp/config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"status": "init",
3+
"scope": "codebase",
4+
"type": "backend",
5+
"localEndpoint": "http://localhost:8080/",
6+
"serverPort": 54926
7+
}

0 commit comments

Comments
 (0)