mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-03 18:23:51 +08:00
fix(ci): satisfy Rust 1.98 clippy checks
This commit is contained in:
@@ -39,8 +39,10 @@ impl StaticEmbedder {
|
||||
let dimensions = tensor.shape()[1];
|
||||
let embeddings = tensor
|
||||
.data()
|
||||
.chunks_exact(2)
|
||||
.map(|value| f16::from_le_bytes([value[0], value[1]]))
|
||||
.as_chunks::<2>()
|
||||
.0
|
||||
.iter()
|
||||
.map(|value| f16::from_le_bytes(*value))
|
||||
.collect();
|
||||
let tokenizer =
|
||||
Tokenizer::from_file(tokenizer).map_err(|error| Error::Model(error.to_string()))?;
|
||||
|
||||
@@ -41,7 +41,7 @@ pub async fn consume_model_cycle(
|
||||
mut stream: ProviderStream,
|
||||
client: &mpsc::Sender<RunEvent>,
|
||||
cancellation: &CancellationToken,
|
||||
) -> std::result::Result<ModelCycleResult, ModelCycleFailure> {
|
||||
) -> std::result::Result<ModelCycleResult, Box<ModelCycleFailure>> {
|
||||
let mut model_call_id = None;
|
||||
let mut text = String::new();
|
||||
let mut reasoning = String::new();
|
||||
@@ -372,15 +372,15 @@ fn failure(
|
||||
partial_text: String,
|
||||
partial_reasoning: String,
|
||||
usage: Option<Usage>,
|
||||
) -> ModelCycleFailure {
|
||||
) -> Box<ModelCycleFailure> {
|
||||
let retryable = matches!(failure, RunFailure::Protocol(_) | RunFailure::Provider(_));
|
||||
ModelCycleFailure {
|
||||
Box::new(ModelCycleFailure {
|
||||
failure,
|
||||
partial_text,
|
||||
partial_reasoning,
|
||||
usage,
|
||||
retryable,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn terminal_failure(
|
||||
@@ -388,14 +388,14 @@ fn terminal_failure(
|
||||
partial_text: String,
|
||||
partial_reasoning: String,
|
||||
usage: Option<Usage>,
|
||||
) -> ModelCycleFailure {
|
||||
ModelCycleFailure {
|
||||
) -> Box<ModelCycleFailure> {
|
||||
Box::new(ModelCycleFailure {
|
||||
failure,
|
||||
partial_text,
|
||||
partial_reasoning,
|
||||
usage,
|
||||
retryable: false,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user