fix: resolve clippy warnings across workspace (#1195)
* fix: resolve clippy warnings across workspace * ci: also run clippy on rmcp with all features except local --all-features enables the local feature, which cfg-gates out tower.rs and most of the test suite, so the existing clippy step never actually lints them.
This commit is contained in:
parent
f9a68bfa5c
commit
6fa40536de
2 changed files with 277 additions and 289 deletions
|
|
@ -100,10 +100,10 @@ impl ProgressAwareClient {
|
|||
}
|
||||
|
||||
fn stop_tracking(&self) {
|
||||
if let Ok(mut tracker_opt) = self.tracker.lock() {
|
||||
if let Some(tracker) = tracker_opt.take() {
|
||||
tracker.print_summary();
|
||||
}
|
||||
if let Ok(mut tracker_opt) = self.tracker.lock()
|
||||
&& let Some(tracker) = tracker_opt.take()
|
||||
{
|
||||
tracker.print_summary();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -114,10 +114,10 @@ impl ClientHandler for ProgressAwareClient {
|
|||
params: ProgressNotificationParam,
|
||||
_context: NotificationContext<RoleClient>,
|
||||
) {
|
||||
if let Ok(tracker_opt) = self.tracker.lock() {
|
||||
if let Some(tracker) = tracker_opt.as_ref() {
|
||||
tracker.handle_progress(¶ms);
|
||||
}
|
||||
if let Ok(tracker_opt) = self.tracker.lock()
|
||||
&& let Some(tracker) = tracker_opt.as_ref()
|
||||
{
|
||||
tracker.handle_progress(¶ms);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -182,10 +182,10 @@ async fn test_stdio_transport(records: u32) -> Result<()> {
|
|||
.call_tool(CallToolRequestParams::new("stream_processor"))
|
||||
.await?;
|
||||
|
||||
if let Some(content) = tool_result.content.first() {
|
||||
if let Some(text) = content.as_text() {
|
||||
tracing::info!("Processing completed: {}", text.text);
|
||||
}
|
||||
if let Some(content) = tool_result.content.first()
|
||||
&& let Some(text) = content.as_text()
|
||||
{
|
||||
tracing::info!("Processing completed: {}", text.text);
|
||||
}
|
||||
|
||||
service.cancel().await?;
|
||||
|
|
@ -236,10 +236,10 @@ async fn test_http_transport(http_url: &str, records: u32) -> Result<()> {
|
|||
.call_tool(CallToolRequestParams::new("stream_processor"))
|
||||
.await?;
|
||||
|
||||
if let Some(content) = tool_result.content.first() {
|
||||
if let Some(text) = content.as_text() {
|
||||
tracing::info!("processing completed: {}", text.text);
|
||||
}
|
||||
if let Some(content) = tool_result.content.first()
|
||||
&& let Some(text) = content.as_text()
|
||||
{
|
||||
tracing::info!("processing completed: {}", text.text);
|
||||
}
|
||||
|
||||
client.cancel().await?;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
#![expect(
|
||||
deprecated,
|
||||
reason = "This example demonstrates the deprecated MCP sampling API"
|
||||
)]
|
||||
|
||||
use anyhow::Result;
|
||||
use rmcp::{
|
||||
ClientHandler, ServiceExt,
|
||||
|
|
|
|||
Loading…
Reference in a new issue