chore: format code correctly (#66)

This commit is contained in:
Jefry Dewangga 2025-03-30 15:29:13 +00:00 • committed by GitHub
commit d6fb12b69f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -164,14 +164,13 @@ impl ServerHandler for Counter {
match name.as_str() { match name.as_str() {
"example_prompt" => { "example_prompt" => {
let message = arguments let message = arguments
.and_then( .and_then(|json| json.get("message")?.as_str().map(|s| s.to_string()))
|json| .ok_or_else(|| {
json.get("message") McpError::invalid_params("No message provided to example_prompt", None)
?.as_str() })?;
.map(|s| s.to_string()))
.ok_or_else(|| McpError::invalid_params("No message provided to example_prompt", None))?;
let prompt = format!("This is an example prompt with your message here: '{message}'"); let prompt =
format!("This is an example prompt with your message here: '{message}'");
Ok(GetPromptResult { Ok(GetPromptResult {
description: None, description: None,
messages: vec![PromptMessage { messages: vec![PromptMessage {