Skip to content

Commit

Permalink
fix: fix typo in drop-callback warning
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfo committed Oct 18, 2024
1 parent 50ef20b commit 3ef7a86
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ use crate::{
type RustCallback<T> = zenoh::handlers::Callback<T>;

const CHECK_SIGNALS_INTERVAL: Duration = Duration::from_millis(100);
const DONE_CALLBACK_WARNING: &str = "Passing drop-callback using a tuple \
`(callback, drop-callback)` no more works in 1.0;\n\
const DROP_CALLBACK_WARNING: &str = "Passing drop-callback using a tuple \
`(callback, drop-callback)` no longer works in 1.0;\n\
`zenoh.handlers.Callback(callback, drop_callback)` must be used instead.\n\
The tuple form is reserved for passing a handler with`(callback, handler)`.\n\
If you are already passing a handler but having this warning wrongly displayed, \
you can silent it with:\n\
The tuple form is reserved for passing a handler with `(callback, handler)`.\n\
If you are already passing a handler and this warning is still incorrectly displayed, \
you can silence it with:\n\
warnings.filterwarnings(\"ignore\", message=\"Passing drop-callback\")";

fn log_error(py: Python, result: PyResult<PyObject>) {
Expand Down Expand Up @@ -444,7 +444,7 @@ where
.filter(|(cb, _)| cb.is_callable())
{
if handler.bind(py).is_callable() {
import!(py, warnings.warn).call1((DONE_CALLBACK_WARNING,))?;
import!(py, warnings.warn).call1((DROP_CALLBACK_WARNING,))?;
}
(python_callback(&cb)?, HandlerImpl::Python(handler))
} else {
Expand Down

0 comments on commit 3ef7a86

Please sign in to comment.