41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
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!")
|