Skip to content

Commit cff8ae3

Browse files
committed
chore: lint driven refactoring
1 parent 6edf82c commit cff8ae3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/agent/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use mini_rag::Embedder;
55
use serde::{Deserialize, Serialize};
66

77
use events::Event;
8-
use generator::{Client, ChatOptions};
8+
use generator::{ChatOptions, Client};
99
use namespaces::Action;
1010
use serialization::xml::serialize;
1111
use state::{SharedState, State};
@@ -82,7 +82,7 @@ impl Invocation {
8282
}
8383
}
8484

85-
return format!("{}({})", &self.action, parts.join(", "));
85+
format!("{}({})", &self.action, parts.join(", "))
8686
}
8787
}
8888

@@ -387,7 +387,7 @@ impl Agent {
387387

388388
let start = std::time::Instant::now();
389389
let mut inp = "nope".to_string();
390-
while inp != "" && inp != "n" && inp != "y" {
390+
while !inp.is_empty() && inp != "n" && inp != "y" {
391391
inp = cli::get_user_input(&format!(
392392
"{} [Yn] ",
393393
inv.as_function_call_string()

src/agent/namespaces/memory/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ impl Action for DeleteMemory {
9393
}
9494
}
9595

96+
/*
9697
#[derive(Debug, Default, Clone)]
9798
struct RecallMemory {}
9899
@@ -130,7 +131,7 @@ impl Action for RecallMemory {
130131
}
131132
}
132133
}
133-
134+
*/
134135
pub(crate) fn get_namespace() -> Namespace {
135136
Namespace::new_default(
136137
"Memory".to_string(),

src/agent/serialization/xml/parsing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn preprocess_block(ptr: &str) -> String {
5858
// not a closing tag
5959
if ptr.as_bytes()[1] != b'/' {
6060
// determine tag name
61-
let tag_name = &ptr[1..ptr.find(|c| c == ' ' || c == '>').unwrap()];
61+
let tag_name = &ptr[1..ptr.find([' ', '>']).unwrap()];
6262
let payload_start_idx = ptr.find('>').unwrap();
6363
// if not a short <tag/>
6464
if !tag_name.ends_with('/') {

0 commit comments

Comments
 (0)