Skip to content

Commit bdd70a1

Browse files
committed
fix: resolve clippy warnings — collapsible_if, manual_pattern_char_comparison
1 parent f379c25 commit bdd70a1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/grounding/hallucination.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ impl<'g> HallucinationDetector<'g> {
249249

250250
for unit in self.graph.units() {
251251
let u_lower = unit.name.to_lowercase();
252-
if u_lower.starts_with(&lower) || lower.starts_with(&u_lower) {
253-
if !results.iter().any(|(n, _)| *n == unit.name) {
254-
results.push((unit.name.clone(), 0));
255-
}
252+
if (u_lower.starts_with(&lower) || lower.starts_with(&u_lower))
253+
&& !results.iter().any(|(n, _)| *n == unit.name)
254+
{
255+
results.push((unit.name.clone(), 0));
256256
}
257257
}
258258

@@ -263,7 +263,7 @@ impl<'g> HallucinationDetector<'g> {
263263

264264
/// Split text into individual claim sentences.
265265
fn split_into_claims(text: &str) -> Vec<String> {
266-
text.split(|c: char| c == '.' || c == '\n')
266+
text.split(['.', '\n'])
267267
.map(|s| s.trim().to_string())
268268
.filter(|s| !s.is_empty() && s.len() > 5)
269269
.collect()

0 commit comments

Comments
 (0)