mirror of
https://github.com/qdrant/qdrant.git
synced 2026-08-06 10:00:58 -05:00
Fix clippy 1.62 (#771)
* clippy let_unit_value
error: this let-binding has unit value
--> lib/segment/src/vector_storage/simple_vector_storage.rs:397:9
|
397 | / let _top_idx = match closest.get(0) {
398 | | Some(scored_point) => {
399 | | assert_ne!(scored_point.idx, 2);
400 | | assert_eq!(&raw_res1[scored_point.idx as usize], scored_point);
... |
404 | | }
405 | | };
| |__________^
|
= note: `-D clippy::let-unit-value` implied by `-D warnings`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
|
397 ~ match closest.get(0) {
398 + Some(scored_point) => {
399 + assert_ne!(scored_point.idx, 2);
400 + assert_eq!(&raw_res1[scored_point.idx as usize], scored_point);
401 + }
402 + None => {
* clippy format_push_string
error: `format!(..)` appended to existing `String`
--> src/main.rs:224:21
|
224 | error.push_str(&format!("Deadlock #{}\n", i));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::format-push-string` implied by `-D warnings`
= help: consider using `write!` to avoid the extra allocation
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
error: `format!(..)` appended to existing `String`
--> src/main.rs:226:25
|
226 | / error.push_str(&format!(
227 | | "Thread Id {:#?}\n{:#?}\n",
228 | | t.thread_id(),
229 | | t.backtrace()
230 | | ));
| |__________________________^
|
= help: consider using `write!` to avoid the extra allocation
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
error: could not compile `qdrant` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `qdrant` due to 2 previous errors
This commit is contained in:
@@ -394,7 +394,7 @@ mod tests {
|
||||
|
||||
assert_eq!(raw_res1, raw_res2);
|
||||
|
||||
let _top_idx = match closest.get(0) {
|
||||
match closest.get(0) {
|
||||
Some(scored_point) => {
|
||||
assert_ne!(scored_point.idx, 2);
|
||||
assert_eq!(&raw_res1[scored_point.idx as usize], scored_point);
|
||||
|
||||
11
src/main.rs
11
src/main.rs
@@ -207,6 +207,7 @@ fn main() -> anyhow::Result<()> {
|
||||
#[cfg(feature = "service_debug")]
|
||||
{
|
||||
use parking_lot::deadlock;
|
||||
use std::fmt::Write;
|
||||
|
||||
const DEADLOCK_CHECK_PERIOD: Duration = Duration::from_secs(10);
|
||||
|
||||
@@ -221,13 +222,15 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
let mut error = format!("{} deadlocks detected\n", deadlocks.len());
|
||||
for (i, threads) in deadlocks.iter().enumerate() {
|
||||
error.push_str(&format!("Deadlock #{}\n", i));
|
||||
writeln!(error, "Deadlock #{}", i).expect("fail to writeln!");
|
||||
for t in threads {
|
||||
error.push_str(&format!(
|
||||
"Thread Id {:#?}\n{:#?}\n",
|
||||
writeln!(
|
||||
error,
|
||||
"Thread Id {:#?}\n{:#?}",
|
||||
t.thread_id(),
|
||||
t.backtrace()
|
||||
));
|
||||
)
|
||||
.expect("fail to writeln!");
|
||||
}
|
||||
}
|
||||
log::error!("{}", error);
|
||||
|
||||
Reference in New Issue
Block a user