Skip to content

Commit

Permalink
Fix example formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
  • Loading branch information
mxgrey committed Nov 20, 2024
1 parent da05361 commit daebaa8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 4 additions & 2 deletions examples/message_demo/src/message_demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ fn demonstrate_pubsub() -> Result<(), Error> {
let context = rclrs::Context::new(env::args())?;
let node = rclrs::create_node(&context, "message_demo")?;

let idiomatic_publisher = node.create_publisher::<rclrs_example_msgs::msg::VariousTypes>("topic")?;
let direct_publisher = node.create_publisher::<rclrs_example_msgs::msg::rmw::VariousTypes>("topic")?;
let idiomatic_publisher =
node.create_publisher::<rclrs_example_msgs::msg::VariousTypes>("topic")?;
let direct_publisher =
node.create_publisher::<rclrs_example_msgs::msg::rmw::VariousTypes>("topic")?;

let _idiomatic_subscription = node
.create_subscription::<rclrs_example_msgs::msg::VariousTypes, _>(
Expand Down
9 changes: 3 additions & 6 deletions examples/rust_pubsub/src/simple_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ impl SimpleSubscriptionNode {
let data: Arc<Mutex<Option<StringMsg>>> = Arc::new(Mutex::new(None));
let data_mut: Arc<Mutex<Option<StringMsg>>> = Arc::clone(&data);
let _subscriber = node
.create_subscription::<StringMsg, _>(
"publish_hello",
move |msg: StringMsg| {
*data_mut.lock().unwrap() = Some(msg);
},
)
.create_subscription::<StringMsg, _>("publish_hello", move |msg: StringMsg| {
*data_mut.lock().unwrap() = Some(msg);
})
.unwrap();
Ok(Self {
node,
Expand Down

0 comments on commit daebaa8

Please sign in to comment.