chore: Remove unused imports and dead code causing compiler warnings

This commit is contained in:
Riz Ashraf committed 2026-09-19 07:58:42 +01:00
1 parent cddd97dc9f
commit e72af4f877
6 files changed
+102 -10

No files matched your search

+40
View File
@@ -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!")