Skip to content

Commit 11bc2df

Browse files
committed
docs: fix doctest compilation errors in actor.rs and gen_server.rs
- Fix string comparison in actor.rs try_receive example by using s.as_str() to properly compare &String with string literal - Add missing CallResponse import in gen_server.rs module doctest example - All 81 unit tests, integration tests, and 85 doctests now passing
1 parent 9ec6998 commit 11bc2df

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

joerl/src/actor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl ActorContext {
429429
/// // Check if there's a ready message without waiting
430430
/// if let Some(ready) = ctx.try_receive(|msg| {
431431
/// msg.downcast_ref::<String>()
432-
/// .filter(|s| s == "ready")
432+
/// .filter(|s| s.as_str() == "ready")
433433
/// .cloned()
434434
/// }) {
435435
/// println!("Got ready signal: {}", ready);

joerl/src/gen_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//! In joerl, the equivalent looks like:
2727
//!
2828
//! ```rust
29-
//! use joerl::gen_server::{GenServer, GenServerContext};
29+
//! use joerl::gen_server::{GenServer, GenServerContext, CallResponse};
3030
//! use async_trait::async_trait;
3131
//!
3232
//! struct Counter;

0 commit comments

Comments
 (0)