chore: Remove unused imports and dead code causing compiler warnings
This commit is contained in:
1 parent
cddd97dc9f
commit
e72af4f877
6 files changed
+102
-10
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import re
|
||||
|
||||
# 1. Fix stub/src/main.rs
|
||||
stub_path = r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\stub\src\main.rs'
|
||||
with open(stub_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
content = content.replace('use tokio::io::AsyncBufReadExt;\n', '')
|
||||
with open(stub_path, 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
# 2. Fix nvim-core/src/lib.rs
|
||||
nvim_path = r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\nvim-core\src\lib.rs'
|
||||
with open(nvim_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
content = content.replace(
|
||||
'use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader};',
|
||||
'use tokio::io::{AsyncReadExt, AsyncWriteExt};'
|
||||
)
|
||||
with open(nvim_path, 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
# 3. Fix server/src/store.rs
|
||||
store_path = r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\src\store.rs'
|
||||
with open(store_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
inspect_method = """ pub fn inspect<F, R>(&self, f: F) -> R
|
||||
where
|
||||
F: FnOnce(&T) -> R,
|
||||
{
|
||||
let lock = self.cache.read().unwrap();
|
||||
f(&lock)
|
||||
}
|
||||
|
||||
"""
|
||||
content = content.replace(inspect_method, "")
|
||||
with open(store_path, 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
print("Warnings fixed!")
|
||||
@@ -1,6 +1,6 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{json, Value};
|
||||
use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader};
|
||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct JsonRpcRequest {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import re
|
||||
|
||||
with open(r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\src\handlers.rs', 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
content = content.replace(
|
||||
'crate::mcp::tool_def::<GenerateStandupReportTool>(\n "generate_standup_report",\n "",\n )',
|
||||
'crate::mcp::tool_def::<GenerateStandupReportTool>(\n "generate_standup_report",\n "Generate a standup report summarizing recent work, blockers, and next steps.",\n )'
|
||||
)
|
||||
|
||||
content = content.replace(
|
||||
'crate::mcp::tool_def::<GetEnvironmentDetailsTool>(\n "get_environment_details",\n "",\n )',
|
||||
'crate::mcp::tool_def::<GetEnvironmentDetailsTool>(\n "get_environment_details",\n "Get detailed information about a specific deployment environment.",\n )'
|
||||
)
|
||||
|
||||
content = content.replace(
|
||||
'crate::mcp::tool_def::<ListContextWorkspacesTool>(\n "list_context_workspaces",\n "",\n )',
|
||||
'crate::mcp::tool_def::<ListContextWorkspacesTool>(\n "list_context_workspaces",\n "List all saved context workspaces.",\n )'
|
||||
)
|
||||
|
||||
with open(r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\src\handlers.rs', 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
print("Descriptions fixed.")
|
||||
@@ -45,14 +45,6 @@ impl<T: DeserializeOwned + Default + Serialize + Clone + Send + 'static> Store<T
|
||||
lock.clone()
|
||||
}
|
||||
|
||||
pub fn inspect<F, R>(&self, f: F) -> R
|
||||
where
|
||||
F: FnOnce(&T) -> R,
|
||||
{
|
||||
let lock = self.cache.read().unwrap();
|
||||
f(&lock)
|
||||
}
|
||||
|
||||
pub fn modify<F: FnOnce(&mut T)>(&self, f: F) {
|
||||
let mut lock = self.cache.write().unwrap();
|
||||
f(&mut lock);
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
eager_tools = [
|
||||
"log_code_change",
|
||||
"log_error_fix",
|
||||
"log_tech_debt",
|
||||
"omni_search",
|
||||
"create_entities",
|
||||
"learn_preference",
|
||||
"list_active_tasks",
|
||||
"add_task",
|
||||
"set_acceptance_criteria",
|
||||
"verify_acceptance_criteria",
|
||||
"update_task_status",
|
||||
"list_pinned_files",
|
||||
"pin_file",
|
||||
"unpin_file",
|
||||
"get_project_health",
|
||||
"list_tech_debt",
|
||||
"resolve_tech_debt"
|
||||
]
|
||||
|
||||
# Update Windows config
|
||||
win_config_path = r'C:\Users\reazul.ashraf\.gemini\config\mcp_config.json'
|
||||
with open(win_config_path, 'r', encoding='utf-8') as f:
|
||||
win_data = json.load(f)
|
||||
|
||||
win_data['mcpServers']['mcp-memory']['eagerTools'] = eager_tools
|
||||
if 'args' in win_data['mcpServers']['mcp-memory']:
|
||||
# Ensure args are empty as we removed --target earlier
|
||||
win_data['mcpServers']['mcp-memory']['args'] = []
|
||||
|
||||
with open(win_config_path, 'w', encoding='utf-8') as f:
|
||||
json.dump(win_data, f, indent=2)
|
||||
|
||||
print("Updated Windows config")
|
||||
@@ -1,7 +1,6 @@
|
||||
use clap::Parser;
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
use std::sync::Arc;
|
||||
use tokio::io::AsyncBufReadExt;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
#[derive(Parser)]
|
||||
|
||||
Reference in new issue
Block a user