Faces worker: collapse the embedding check (clippy).
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017sovZz1NXBwx4VySojoyA1
This commit is contained in:
1 parent
db84533632
commit
fa14bf91f5
1 file changed
+5
-4
@@ -205,10 +205,11 @@ impl Engine {
|
||||
want: usize,
|
||||
embed: &mut dyn FnMut(&[u8]) -> Option<Vec<f32>>,
|
||||
) -> Option<Vec<f32>> {
|
||||
if let Some(vector) = embed(crop) {
|
||||
if vector.len() == want && vector.iter().all(|value| value.is_finite()) {
|
||||
return Some(vector);
|
||||
}
|
||||
if let Some(vector) = embed(crop)
|
||||
&& vector.len() == want
|
||||
&& vector.iter().all(|value| value.is_finite())
|
||||
{
|
||||
return Some(vector);
|
||||
}
|
||||
self.models.embedder.embed(crop).ok()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user