Skip to content

Commit 185eb3e

Browse files
AlexMikhalevclaude
andcommitted
feat: standardize Rust edition 2024 across workspace
- Update 28 crates to use edition.workspace = true (edition 2024) - Keep 8 crates on edition 2021 due to set_var/remove_var unsafe requirements: terraphim_github_runner_server, terraphim_update, terraphim_multi_agent, terraphim_config, terraphim_middleware, terraphim_service, terraphim_mcp_server, terraphim_ai_nodejs - Fix edition 2024 breaking changes: - Pattern binding: remove explicit 'ref' in matches (implicit borrowing) - Derivable impl: add #[derive(Default)] with #[default] attribute - Let-and-return: return expressions directly - Unused imports: move to appropriate cfg(test) modules - Add TuiService tests for search, autocomplete, replace_matches, summarize - Update handler to use TuiService.search() convenience method - Fix double-dereference patterns in test code for edition 2024 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c0b0504 commit 185eb3e

167 files changed

Lines changed: 986 additions & 587 deletions

File tree

Some content is hidden

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

crates/haystack_atlassian/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "atlassian_haystack"
33
version = "1.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
license = "MIT"
66

77
[dependencies]

crates/haystack_discourse/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "discourse_haystack"
33
version = "1.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["Terraphim"]
66
description = "A CLI client for fetching Discourse posts and messages"
77
license = "MIT"

crates/haystack_discourse/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ mod tests {
130130
use super::*;
131131
use serde_json::json;
132132
use wiremock::{
133-
matchers::{header, method, path, query_param},
134133
Mock, MockServer, ResponseTemplate,
134+
matchers::{header, method, path, query_param},
135135
};
136136

137137
fn can_bind_localhost() -> bool {

crates/haystack_jmap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "jmap_client"
33
version = "1.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
license = "MIT"
66

77
[dependencies]

crates/terraphim-markdown-parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "terraphim-markdown-parser"
33
version = "1.0.0"
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["Terraphim Contributors"]
66
description = "Terraphim Markdown Parser"
77
documentation = "https://terraphim.ai"

crates/terraphim-markdown-parser/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use std::collections::HashSet;
22
use std::ops::Range;
33
use std::str::FromStr;
44

5-
use markdown::mdast::Node;
65
use markdown::ParseOptions;
6+
use markdown::mdast::Node;
77
use terraphim_types::{Document, DocumentType};
88
use thiserror::Error;
99
use ulid::Ulid;

crates/terraphim-session-analyzer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "terraphim-session-analyzer"
33
version.workspace = true
4-
edition = "2021"
4+
edition.workspace = true
55
authors = ["Zestic AI Development Team"]
66
description = "Analyze AI coding assistant session logs to identify agent usage patterns"
77
documentation = "https://terraphim.ai"

crates/terraphim-session-analyzer/src/kg/query.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{anyhow, Result};
1+
use anyhow::{Result, anyhow};
22

33
/// Query AST node representing a parsed query
44
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -157,7 +157,7 @@ impl ParserState {
157157
fn parse_not_expression(&mut self) -> Result<QueryNode> {
158158
if let Some(Token::Not) = self.peek() {
159159
self.consume(); // consume NOT
160-
// Recursively parse NOT expressions to support "not not X"
160+
// Recursively parse NOT expressions to support "not not X"
161161
let operand = self.parse_not_expression()?;
162162
Ok(QueryNode::Not(Box::new(operand)))
163163
} else {
@@ -168,7 +168,7 @@ impl ParserState {
168168
/// Parse primary terms (concepts or parenthesized expressions)
169169
fn parse_primary(&mut self) -> Result<QueryNode> {
170170
match self.peek() {
171-
Some(Token::Concept(ref concept)) => {
171+
Some(Token::Concept(concept)) => {
172172
let concept = concept.clone();
173173
self.consume();
174174
Ok(QueryNode::Concept(concept))
@@ -494,10 +494,12 @@ mod tests {
494494
let query = "(deploy and publish";
495495
let result = QueryParser::parse(query);
496496
assert!(result.is_err());
497-
assert!(result
498-
.unwrap_err()
499-
.to_string()
500-
.contains("closing parenthesis"));
497+
assert!(
498+
result
499+
.unwrap_err()
500+
.to_string()
501+
.contains("closing parenthesis")
502+
);
501503
}
502504

503505
#[test]

crates/terraphim-session-analyzer/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ pub mod connectors;
4949
// Re-export main types for convenience
5050
pub use analyzer::{Analyzer, SummaryStats};
5151
pub use models::{
52-
get_agent_category, normalize_agent_name, AgentAttribution, AgentInvocation, AgentStatistics,
53-
AgentToolCorrelation, AnalyzerConfig, CollaborationPattern, FileOperation, SessionAnalysis,
54-
ToolAnalysis, ToolCategory, ToolChain, ToolInvocation, ToolStatistics,
52+
AgentAttribution, AgentInvocation, AgentStatistics, AgentToolCorrelation, AnalyzerConfig,
53+
CollaborationPattern, FileOperation, SessionAnalysis, ToolAnalysis, ToolCategory, ToolChain,
54+
ToolInvocation, ToolStatistics, get_agent_category, normalize_agent_name,
5555
};
5656
pub use parser::{SessionParser, TimelineEvent, TimelineEventType};
5757
pub use patterns::{
58-
create_matcher, load_patterns, AhoCorasickMatcher, PatternMatcher, ToolMatch, ToolMetadata,
59-
ToolPattern,
58+
AhoCorasickMatcher, PatternMatcher, ToolMatch, ToolMetadata, ToolPattern, create_matcher,
59+
load_patterns,
6060
};
6161
pub use reporter::Reporter;
6262

crates/terraphim-session-analyzer/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use tracing::{info, warn};
1515

1616
use analyzer::Analyzer;
1717
use parser::SessionParser;
18-
use patterns::{load_all_patterns, AhoCorasickMatcher, PatternMatcher};
18+
use patterns::{AhoCorasickMatcher, PatternMatcher, load_all_patterns};
1919
use reporter::Reporter;
2020

2121
#[derive(Parser)]

0 commit comments

Comments
 (0)