style: fix clippy collapsible_if warnings in nvim-core
This commit is contained in:
1 parent
148025c5a7
commit
b2f15de58c
8 files changed
+105
-89
No files matched your search
@@ -68,7 +68,9 @@ pub async fn gate_verify_handler(
|
||||
Err(AppError::Forbidden(msg))
|
||||
}
|
||||
}
|
||||
None => Err(AppError::NotFound("Action not yet authorized (no gate record found).".to_string())),
|
||||
None => Err(AppError::NotFound(
|
||||
"Action not yet authorized (no gate record found).".to_string(),
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +100,7 @@ pub async fn gate_set_handler(
|
||||
gates.retain(|g| !(g.action == record.action && g.target == record.target));
|
||||
gates.push(record);
|
||||
});
|
||||
|
||||
|
||||
Ok((axum::http::StatusCode::OK, "Gate state updated."))
|
||||
}
|
||||
|
||||
|
||||
+3
-6
@@ -1,7 +1,7 @@
|
||||
use crate::store::STORE_TABLE;
|
||||
use redb::{Database, ReadableTable};
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use redb::{Database, ReadableTable};
|
||||
use crate::store::STORE_TABLE;
|
||||
|
||||
pub fn init_redb(base: &Path) -> Arc<Database> {
|
||||
let redb_path = base.join("mcp_store.redb");
|
||||
@@ -50,10 +50,7 @@ pub fn init_redb(base: &Path) -> Arc<Database> {
|
||||
table
|
||||
.insert(*key, data.as_slice())
|
||||
.expect("Failed to insert migrated data");
|
||||
let _ = std::fs::rename(
|
||||
&json_path,
|
||||
json_path.with_extension("json.migrated"),
|
||||
);
|
||||
let _ = std::fs::rename(&json_path, json_path.with_extension("json.migrated"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
use axum::{
|
||||
Json,
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Response},
|
||||
Json,
|
||||
};
|
||||
use serde_json::json;
|
||||
use thiserror::Error;
|
||||
|
||||
@@ -244,8 +244,7 @@ impl McpTool for GenerateStandupReportHandler {
|
||||
async fn execute(&self, args: Value, state: Arc<MemoryState>) -> Result<String, String> {
|
||||
let req: GenerateStandupReportTool =
|
||||
serde_json::from_value(args).map_err(|e| e.to_string())?;
|
||||
let cutoff =
|
||||
crate::handlers::utils::now_secs().saturating_sub(req.hours_lookback * 3600);
|
||||
let cutoff = crate::handlers::utils::now_secs().saturating_sub(req.hours_lookback * 3600);
|
||||
|
||||
let report_str = state.tasks.read_with(|items| {
|
||||
state.ledger.read_with(|changes| {
|
||||
|
||||
+2
-2
@@ -4,13 +4,13 @@
|
||||
)]
|
||||
|
||||
mod api;
|
||||
pub mod db;
|
||||
pub mod error;
|
||||
mod handlers;
|
||||
mod mcp;
|
||||
mod models;
|
||||
mod router;
|
||||
mod search;
|
||||
pub mod db;
|
||||
pub mod error;
|
||||
mod state;
|
||||
mod store;
|
||||
mod tools;
|
||||
|
||||
Reference in new issue
Block a user