refactor(message): update message api types #534
Annotations
8 errors and 1 warning
Run clippy action:
rig-core/src/agent.rs#L190
error: this expression creates a reference which is immediately dereferenced by the compiler
--> rig-core/src/agent.rs:190:40
|
190 | ... .top_n(&text, *num_sample)
| ^^^^^ help: change this to: `text`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-D clippy::needless-borrow` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`
|
Run clippy action:
rig-core/src/agent.rs#L218
error: this expression creates a reference which is immediately dereferenced by the compiler
--> rig-core/src/agent.rs:218:44
|
218 | ... .top_n_ids(&text, *num_sample)
| ^^^^^ help: change this to: `text`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
Run clippy action:
rig-core/src/message.rs#L75
error: this `impl` can be derived
--> rig-core/src/message.rs:75:1
|
75 | / impl Default for ContentFormat {
76 | | fn default() -> Self {
77 | | ContentFormat::Base64
78 | | }
79 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `-D clippy::derivable-impls` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::derivable_impls)]`
= help: remove the manual implementation...
help: ...and instead derive it...
|
70 + #[derive(Default)]
71 | pub enum ContentFormat {
|
help: ...and mark the default variant
|
71 ~ #[default]
72 ~ Base64,
|
|
Run clippy action:
rig-core/src/message.rs#L208
error: this `impl` can be derived
--> rig-core/src/message.rs:208:1
|
208 | / impl Default for ImageDetail {
209 | | fn default() -> Self {
210 | | ImageDetail::Auto
211 | | }
212 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= help: remove the manual implementation...
help: ...and instead derive it...
|
202 + #[derive(Default)]
203 | pub enum ImageDetail {
|
help: ...and mark the default variant
|
205 ~ #[default]
206 ~ Auto,
|
|
Run clippy action:
rig-core/src/providers/anthropic/completion.rs#L311
error: unneeded `return` statement
--> rig-core/src/providers/anthropic/completion.rs:311:25
|
311 | / return Err(MessageError::ConversionError(
312 | | "Audio is not supported in Anthropic".to_owned(),
313 | | ))
| |__________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
|
311 ~ Err(MessageError::ConversionError(
312 + "Audio is not supported in Anthropic".to_owned(),
313 + ))
|
|
Run clippy action:
rig-core/src/providers/cohere.rs#L563
error: redundant closure
--> rig-core/src/providers/cohere.rs:563:18
|
563 | .map(|msg| Vec::<Message>::try_from(msg))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Vec::<Message>::try_from`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `-D clippy::redundant-closure` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]`
|
Run clippy action:
rig-core/src/providers/gemini/completion.rs#L74
error: manual implementation of `Option::map`
--> rig-core/src/providers/gemini/completion.rs:74:34
|
74 | let system_instruction = if let Some(preamble) = completion_request.preamble.clone() {
| __________________________________^
75 | | Some(Content {
76 | | parts: vec![preamble.into()],
77 | | role: Some(Role::Model),
... |
80 | | None
81 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
= note: `-D clippy::manual-map` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_map)]`
help: try
|
74 ~ let system_instruction = completion_request.preamble.clone().map(|preamble| Content {
75 + parts: vec![preamble.into()],
76 + role: Some(Role::Model),
77 ~ });
|
|
Run clippy action
Clippy has exited with exit code 101
|
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Loading