Skip to content

Commit 591198e

Browse files
committed
fix(inference): address clippy lints in build_vertex_route
- Invert if !is_anthropic to satisfy clippy::if_not_else - Replace match on Option with map_or_else to satisfy clippy::option_if_let_else Signed-off-by: politerealism <[email protected]>
1 parent eab2fe9 commit 591198e

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎crates/openshell-server/src/inference.rs‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -707,14 +707,11 @@ fn resolve_vertex_ai_route(
707707
// a 400 in that case, which is the correct observable signal to the caller.
708708
// Anthropic rawPredict routes encode the model in the URL path, not the
709709
// body, so they are unaffected.
710-
let body_model_id: String = if !is_anthropic {
711-
let publisher = explicit_publisher.or_else(|| infer_vertex_publisher(model_id));
712-
match publisher {
713-
Some(p) => format!("{p}/{model_id}"),
714-
None => model_id.to_string(),
715-
}
716-
} else {
710+
let body_model_id: String = if is_anthropic {
717711
model_id.to_string()
712+
} else {
713+
let publisher = explicit_publisher.or_else(|| infer_vertex_publisher(model_id));
714+
publisher.map_or_else(|| model_id.to_string(), |p| format!("{p}/{model_id}"))
718715
};
719716

720717
// Escape hatch: caller-supplied full base URL still uses the model-derived

0 commit comments

Comments
 (0)