@@ -92,7 +92,6 @@ To construct a node, replace the code in your `main.rs` file with the following:
92
92
``` rust
93
93
/// Creates a SimplePublisherNode, initializes a node and publisher, and provides
94
94
/// methods to publish a simple "Hello World" message on a loop in separate threads.
95
-
96
95
use rclrs :: {create_node, Context , Node , Publisher , RclrsError , QOS_PROFILE_DEFAULT };
97
96
use std :: {env, sync :: Arc , thread, time :: Duration };
98
97
use std_msgs :: msg :: String as StringMsg ;
@@ -103,12 +102,12 @@ struct SimplePublisherNode {
103
102
publisher : Arc <Publisher <StringMsg >>,
104
103
}
105
104
impl SimplePublisherNode {
106
- fn new (context : & context ) -> result < self , RclrsError > {
105
+ fn new (context : & Context ) -> Result < Self , RclrsError > {
107
106
let node = create_node (context , " simple_publisher" ). unwrap ();
108
107
let publisher = node
109
- . create_publisher (" publish_hello" , qos_profile_default )
108
+ . create_publisher (" publish_hello" , QOS_PROFILE_DEFAULT )
110
109
. unwrap ();
111
- ok ( self { node , publisher })
110
+ Ok ( Self { node , publisher })
112
111
}
113
112
fn publish_data (& self , increment : i32 ) -> Result <i32 , RclrsError > {
114
113
let msg : StringMsg = StringMsg {
0 commit comments