Fix compile errors

This commit is contained in:
Danielle Jenkins 2025-03-06 23:00:13 -08:00
parent 67a48cd6f8
commit 06514ed935
3 changed files with 9 additions and 3 deletions

View file

@ -14,7 +14,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
use anyhow::Result;
use mcp_server::router::RouterService;
use rust_doc_server::{jsonrpc_frame_codec::JsonRpcFrameCodec, DocRouter};
use cratedocs_mcp::{jsonrpc_frame_codec::JsonRpcFrameCodec, DocRouter};
use std::sync::Arc;
use tokio::{
io::{self, AsyncWriteExt},
@ -131,7 +131,7 @@ async fn sse_handler(State(app): State<App>) -> Sse<impl Stream<Item = Result<Ev
.chain(
FramedRead::new(s2c_read, JsonRpcFrameCodec)
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))
.and_then(move |bytes| match std::str::from_utf8(&bytes) {
.and_then(move |bytes| match std::str::from_utf8(bytes.as_ref()) {
Ok(message) => futures::future::ok(Event::default().event("message").data(message)),
Err(e) => futures::future::err(io::Error::new(io::ErrorKind::InvalidData, e)),
}),

View file

@ -1,7 +1,7 @@
use anyhow::Result;
use mcp_server::router::RouterService;
use mcp_server::{ByteTransport, Server};
use rust_doc_server::DocRouter;
use cratedocs_mcp::DocRouter;
use tokio::io::{stdin, stdout};
use tracing_appender::rolling::{RollingFileAppender, Rotation};
use tracing_subscriber::{self, EnvFilter};

View file

@ -41,6 +41,12 @@ pub struct DocRouter {
cache: DocCache,
}
impl Default for DocRouter {
fn default() -> Self {
Self::new()
}
}
impl DocRouter {
pub fn new() -> Self {
Self {