Skip to content

Commit 38f6e65

Browse files
committed
fix clippy warning
1 parent b4d6f47 commit 38f6e65

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

async-openai/src/types/impls.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use super::{
1818
EmbeddingInput, FileExpiresAfterAnchor, FileInput, FilePurpose, FunctionName, ImageInput,
1919
ImageModel, ImageResponseFormat, ImageSize, ImageUrl, ModerationInput, Prompt, Role, Stop,
2020
TimestampGranularity, VideoSize,
21-
responses::{CodeInterpreterContainer, Input, InputContent, Role as ResponsesRole},
21+
responses::{CodeInterpreterContainer, Input, InputContent},
2222
};
2323
use crate::traits::AsyncTryFrom;
2424
use crate::{error::OpenAIError, types::InputSource, util::create_file_part};
@@ -991,12 +991,6 @@ impl From<&str> for Input {
991991
}
992992
}
993993

994-
impl Default for ResponsesRole {
995-
fn default() -> Self {
996-
Self::User
997-
}
998-
}
999-
1000994
impl From<String> for InputContent {
1001995
fn from(value: String) -> Self {
1002996
Self::TextInput(value)

async-openai/src/types/responses.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ use serde_json::Value;
1010
use std::collections::HashMap;
1111

1212
/// Role of messages in the API.
13-
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)]
13+
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Default)]
1414
#[serde(rename_all = "lowercase")]
1515
pub enum Role {
16+
#[default]
1617
User,
1718
Assistant,
1819
System,

0 commit comments

Comments
 (0)