From f8ae02f79b0ed6e035b255b3f1bb1d6fe1bf319b Mon Sep 17 00:00:00 2001 From: rex-schilasky <49162693+rex-schilasky@users.noreply.github.com> Date: Mon, 19 May 2025 15:47:22 +0200 Subject: [PATCH] more explicitly named entities --- docs/src/examples/binary.md | 8 ++++---- docs/src/examples/protobuf.md | 8 ++++---- docs/src/examples/string.md | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/src/examples/binary.md b/docs/src/examples/binary.md index 55d133a..d173c79 100644 --- a/docs/src/examples/binary.md +++ b/docs/src/examples/binary.md @@ -9,12 +9,12 @@ use rustecal_types_bytes::BytesMessage; fn main() -> Result<(), Box> { Ecal::initialize(Some("blob publisher"), EcalComponents::DEFAULT)?; - let pub_ = TypedPublisher::::new("blob")?; + let publisher = TypedPublisher::::new("blob")?; let mut counter = 0u8; while Ecal::ok() { let buf = vec![counter; 1024]; - pub_.send(&BytesMessage(Arc::from(buf))); + publisher.send(&BytesMessage(Arc::from(buf))); counter = counter.wrapping_add(1); std::thread::sleep(std::time::Duration::from_millis(500)); @@ -34,8 +34,8 @@ use rustecal_types_bytes::BytesMessage; fn main() -> Result<(), Box> { Ecal::initialize(Some("blob subscriber"), EcalComponents::DEFAULT)?; - let mut sub = TypedSubscriber::::new("blob")?; - sub.set_callback(|msg| { + let mut subscriber = TypedSubscriber::::new("blob")?; + subscriber.set_callback(|msg| { println!("Received blob of {} bytes", msg.msg.0.len()); }); diff --git a/docs/src/examples/protobuf.md b/docs/src/examples/protobuf.md index c0c5a40..8962f0e 100644 --- a/docs/src/examples/protobuf.md +++ b/docs/src/examples/protobuf.md @@ -17,11 +17,11 @@ impl IsProtobufType for Person {} fn main() -> Result<(), Box> { Ecal::initialize(Some("protobuf publisher"), EcalComponents::DEFAULT)?; - let pub_ = TypedPublisher::>::new("person")?; + let publisher = TypedPublisher::>::new("person")?; while Ecal::ok() { let person = Person { id: 1, name: "Alice".into(), ..Default::default() }; - pub_.send(&ProtobufMessage(Arc::from(person))); + publisher.send(&ProtobufMessage(Arc::from(person))); std::thread::sleep(std::time::Duration::from_millis(500)); } @@ -47,8 +47,8 @@ impl IsProtobufType for Person {} fn main() -> Result<(), Box> { Ecal::initialize(Some("protobuf subscriber"), EcalComponents::DEFAULT)?; - let mut sub = TypedSubscriber::>::new("person")?; - sub.set_callback(|msg| println!("Received person: {}", msg.msg.0.name)); + let mut subscriber = TypedSubscriber::>::new("person")?; + subscriber.set_callback(|msg| println!("Received person: {}", msg.msg.0.name)); while Ecal::ok() { std::thread::sleep(std::time::Duration::from_millis(500)); diff --git a/docs/src/examples/string.md b/docs/src/examples/string.md index 383d9af..843b178 100644 --- a/docs/src/examples/string.md +++ b/docs/src/examples/string.md @@ -32,8 +32,8 @@ use rustecal_types_string::StringMessage; fn main() -> Result<(), Box> { Ecal::initialize(Some("string subscriber"), EcalComponents::DEFAULT)?; - let mut sub = TypedSubscriber::::new("hello")?; - sub.set_callback(|msg| println!("Received: {}", msg.msg.0)); + let mut subscriber = TypedSubscriber::::new("hello")?; + subscriber.set_callback(|msg| println!("Received: {}", msg.msg.0)); while Ecal::ok() { std::thread::sleep(std::time::Duration::from_millis(500));