Skip to content

Commit

Permalink
change Err from Debug to Display
Browse files Browse the repository at this point in the history
as reported by a user on Discord, the output of the Debug on error is a useless: 'Any { .. }'
switch to `Display` via to_string
  • Loading branch information
PSeitz committed Sep 27, 2023
1 parent 34920d3 commit dc90e4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/indexer/index_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ impl IndexWriter {
for worker_handle in former_workers_join_handle {
let indexing_worker_result = worker_handle
.join()
.map_err(|e| TantivyError::ErrorInThread(format!("{e:?}")))?;
.map_err(|e| TantivyError::ErrorInThread(e.to_string()))?;

Check failure on line 623 in src/indexer/index_writer.rs

View workflow job for this annotation

GitHub Actions / clippy

the method `to_string` exists for struct `Box<dyn Any + Send>`, but its trait bounds were not satisfied

error[E0599]: the method `to_string` exists for struct `Box<dyn Any + Send>`, but its trait bounds were not satisfied --> src/indexer/index_writer.rs:623:60 | 623 | .map_err(|e| TantivyError::ErrorInThread(e.to_string()))?; | ^^^^^^^^^ method cannot be called on `Box<dyn Any + Send>` due to unsatisfied trait bounds --> /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/any.rs:181:1 | = note: doesn't satisfy `_: Display` | = note: doesn't satisfy `_: ToString` --> /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/alloc/src/boxed.rs:195:1 ::: /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/alloc/src/boxed.rs:198:1 | = note: doesn't satisfy `_: Display` | = note: doesn't satisfy `_: ToString` | = note: the following trait bounds were not satisfied: `std::boxed::Box<dyn std::any::Any + std::marker::Send>: std::fmt::Display` which is required by `std::boxed::Box<dyn std::any::Any + std::marker::Send>: std::string::ToString` `dyn std::any::Any + std::marker::Send: std::fmt::Display` which is required by `dyn std::any::Any + std::marker::Send: std::string::ToString`
indexing_worker_result?;
self.add_indexing_worker()?;
}
Expand Down

0 comments on commit dc90e4f

Please sign in to comment.