Skip to content

Commit 6532bd5

Browse files
author
=
committed
fix typos
1 parent 8678afb commit 6532bd5

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

crates/rmcp/src/transport/sse.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ enum SseTransportState {
4242
}
4343

4444
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
45-
pub struct SseTransportRetryCofnig {
45+
pub struct SseTransportRetryConfig {
4646
pub max_times: Option<usize>,
4747
pub min_duration: Duration,
4848
}
49-
impl SseTransportRetryCofnig {
49+
impl SseTransportRetryConfig {
5050
pub const DEFAULT_MIN_DURATION: Duration = Duration::from_millis(1000);
5151
}
52-
impl Default for SseTransportRetryCofnig {
52+
impl Default for SseTransportRetryConfig {
5353
fn default() -> Self {
5454
Self {
5555
max_times: None,
@@ -69,10 +69,10 @@ pub struct SseTransport {
6969
post_url: Arc<Url>,
7070
sse_url: Arc<Url>,
7171
last_event_id: Option<String>,
72-
recommanded_retry_duration_ms: Option<u64>,
72+
recommended_retry_duration_ms: Option<u64>,
7373
#[allow(clippy::type_complexity)]
7474
request_queue: VecDeque<tokio::sync::oneshot::Receiver<Result<(), SseTransportError>>>,
75-
pub retry_config: SseTransportRetryCofnig,
75+
pub retry_config: SseTransportRetryConfig,
7676
}
7777

7878
impl SseTransport {
@@ -140,7 +140,7 @@ impl SseTransport {
140140
state: SseTransportState::Connected(Box::pin(event_stream)),
141141
post_url: Arc::from(post_url),
142142
last_event_id,
143-
recommanded_retry_duration_ms: retry,
143+
recommended_retry_duration_ms: retry,
144144
sse_url: Arc::from(url),
145145
request_queue: Default::default(),
146146
retry_config: Default::default(),
@@ -152,11 +152,11 @@ impl SseTransport {
152152
) -> BoxFuture<'static, Result<BoxStream<'static, Result<Sse, SseError>>, SseTransportError>>
153153
{
154154
let retry_duration = {
155-
let recommanded_retry_duration = self
156-
.recommanded_retry_duration_ms
155+
let recommended_retry_duration = self
156+
.recommended_retry_duration_ms
157157
.map(Duration::from_millis);
158158
let config_retry_duration = self.retry_config.min_duration;
159-
recommanded_retry_duration
159+
recommended_retry_duration
160160
.map(|d| d.max(config_retry_duration))
161161
.unwrap_or(config_retry_duration)
162162
};
@@ -203,7 +203,7 @@ impl Stream for SseTransport {
203203
match event {
204204
Some(Ok(event)) => {
205205
if let Some(retry) = event.retry {
206-
self.recommanded_retry_duration_ms = Some(retry);
206+
self.recommended_retry_duration_ms = Some(retry);
207207
}
208208
if let Some(id) = event.id {
209209
self.last_event_id = Some(id);

crates/rmcp/src/transport/sse_server.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub type TransportReceiver = ReceiverStream<RxJsonRpcMessage<RoleServer>>;
2929
#[derive(Clone)]
3030
struct App {
3131
txs: TxStore,
32-
tranport_tx: tokio::sync::mpsc::UnboundedSender<SseServerTransport>,
32+
transport_tx: tokio::sync::mpsc::UnboundedSender<SseServerTransport>,
3333
post_path: Arc<str>,
3434
}
3535

@@ -40,11 +40,11 @@ impl App {
4040
Self,
4141
tokio::sync::mpsc::UnboundedReceiver<SseServerTransport>,
4242
) {
43-
let (tranport_tx, tranport_rx) = tokio::sync::mpsc::unbounded_channel();
43+
let (transport_tx, tranport_rx) = tokio::sync::mpsc::unbounded_channel();
4444
(
4545
Self {
4646
txs: Default::default(),
47-
tranport_tx,
47+
transport_tx,
4848
post_path: post_path.into(),
4949
},
5050
tranport_rx,
@@ -104,7 +104,7 @@ async fn sse_handler(
104104
session_id: session.clone(),
105105
tx_store: app.txs.clone(),
106106
};
107-
let transport_send_result = app.tranport_tx.send(transport);
107+
let transport_send_result = app.transport_tx.send(transport);
108108
if transport_send_result.is_err() {
109109
tracing::warn!("send transport out error");
110110
let mut response =

0 commit comments

Comments
 (0)