Fix cargo clippy warnings across the workspace
All checks were successful
dev release / build (push) Successful in 4m4s

- Derive Default for Config instead of manually mirroring each
  sub-config's Default impl
- Use std::io::Error::other instead of Error::new(ErrorKind::Other, ..)
- Drop the unused mut on the store lock in full_reindex
- Remove Store::dim, a field that was set once and never read
- Use char_indices().enumerate() instead of a hand-rolled loop counter
  in split_by_chars, and is_multiple_of() for the chunk boundary check
- Use strip_prefix instead of manual slicing in expand_home

(cherry picked from commit b740af38e17d04bd83db93bbb0585ed5744a436e)
This commit is contained in:
Breadway 2026-08-06 08:52:18 +08:00
parent 4bfcc694bd
commit 993dc4a525
4 changed files with 8 additions and 22 deletions

View file

@ -43,7 +43,7 @@ pub fn socket_path() -> PathBuf {
// ---- Config -----------------------------------------------------------------
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct Config {
#[serde(default)]
pub index: IndexConfig,
@ -157,16 +157,6 @@ impl Default for ModelConfig {
}
}
impl Default for Config {
fn default() -> Self {
Self {
index: IndexConfig::default(),
search: SearchConfig::default(),
model: ModelConfig::default(),
power: PowerConfig::default(),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PowerConfig {
@ -255,8 +245,7 @@ pub struct StatusInfo {
pub fn send_request(req: &Request) -> std::io::Result<Response> {
let mut stream = UnixStream::connect(socket_path())?;
let mut line = serde_json::to_string(req)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
let mut line = serde_json::to_string(req).map_err(std::io::Error::other)?;
line.push('\n');
stream.write_all(line.as_bytes())?;
stream.flush()?;