Skip to content

Commit

Permalink
style: use is_none_or instead of map_or per clippy warnings rust >= 1…
Browse files Browse the repository at this point in the history
….85.0 (#1314)
  • Loading branch information
kalvinnchau authored Feb 20, 2025
1 parent 3af2bf8 commit 6881953
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/goose/src/providers/formats/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ fn ensure_valid_json_schema(schema: &mut Value) {
let is_object_type = params_obj
.get("type")
.and_then(|t| t.as_str())
.map_or(true, |t| t == "object"); // Default to true if no type is specified
.is_none_or(|t| t == "object"); // Default to true if no type is specified

// Only apply full schema validation to object types
if is_object_type {
Expand Down
2 changes: 1 addition & 1 deletion crates/mcp-server/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ pub trait Router: Send + Sync + 'static {
|| arguments
.get(&arg.name)
.and_then(Value::as_str)
.map_or(true, str::is_empty))
.is_none_or(str::is_empty))
{
return Err(RouterError::InvalidParams(format!(
"Missing required argument: '{}'",
Expand Down

0 comments on commit 6881953

Please sign in to comment.