mirror of
https://github.com/katanemo/plano.git
synced 2026-04-27 17:56:28 +02:00
fix: silence collapsible_match clippy lint (rustc 1.95)
Made-with: Cursor
This commit is contained in:
parent
a04571afbc
commit
cb2fdc9dbf
5 changed files with 21 additions and 29 deletions
|
|
@ -188,14 +188,13 @@ pub fn convert_openai_message_to_anthropic_content(
|
|||
|
||||
// Handle regular content
|
||||
match &message.content {
|
||||
Some(MessageContent::Text(text)) => {
|
||||
if !text.is_empty() {
|
||||
blocks.push(MessagesContentBlock::Text {
|
||||
text: text.clone(),
|
||||
cache_control: None,
|
||||
});
|
||||
}
|
||||
Some(MessageContent::Text(text)) if !text.is_empty() => {
|
||||
blocks.push(MessagesContentBlock::Text {
|
||||
text: text.clone(),
|
||||
cache_control: None,
|
||||
});
|
||||
}
|
||||
Some(MessageContent::Text(_)) => {}
|
||||
Some(MessageContent::Parts(parts)) => {
|
||||
for part in parts {
|
||||
match part {
|
||||
|
|
|
|||
|
|
@ -354,10 +354,10 @@ impl TryFrom<MessagesMessage> for BedrockMessage {
|
|||
MessagesMessageContent::Blocks(blocks) => {
|
||||
for block in blocks {
|
||||
match block {
|
||||
crate::apis::anthropic::MessagesContentBlock::Text { text, .. } => {
|
||||
if !text.is_empty() {
|
||||
content_blocks.push(ContentBlock::Text { text });
|
||||
}
|
||||
crate::apis::anthropic::MessagesContentBlock::Text { text, .. }
|
||||
if !text.is_empty() =>
|
||||
{
|
||||
content_blocks.push(ContentBlock::Text { text });
|
||||
}
|
||||
crate::apis::anthropic::MessagesContentBlock::ToolUse {
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -317,11 +317,10 @@ impl TryFrom<Message> for BedrockMessage {
|
|||
Role::User => {
|
||||
// Convert user message content to content blocks
|
||||
match message.content {
|
||||
Some(MessageContent::Text(text)) => {
|
||||
if !text.is_empty() {
|
||||
content_blocks.push(ContentBlock::Text { text });
|
||||
}
|
||||
Some(MessageContent::Text(text)) if !text.is_empty() => {
|
||||
content_blocks.push(ContentBlock::Text { text });
|
||||
}
|
||||
Some(MessageContent::Text(_)) => {}
|
||||
Some(MessageContent::Parts(parts)) => {
|
||||
// Convert OpenAI content parts to Bedrock ContentBlocks
|
||||
for part in parts {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue