File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -31,18 +31,19 @@ async fn main() {
31
31
let session = zenoh:: open ( config) . await . unwrap ( ) ;
32
32
33
33
println ! ( "Sending Query '{selector}'..." ) ;
34
- let replies = session
34
+ let mut builder = session
35
35
. get ( & selector)
36
36
// // By default get receives replies from a FIFO.
37
37
// // Uncomment this line to use a ring channel instead.
38
38
// // More information on the ring channel are available in the z_pull example.
39
39
// .with(zenoh::handlers::RingChannel::default())
40
40
// Refer to z_bytes.rs to see how to serialize different types of message
41
- . payload ( payload. unwrap_or_default ( ) )
42
41
. target ( target)
43
- . timeout ( timeout)
44
- . await
45
- . unwrap ( ) ;
42
+ . timeout ( timeout) ;
43
+ if let Some ( payload) = payload {
44
+ builder = builder. payload ( payload) ;
45
+ }
46
+ let replies = builder. await . unwrap ( ) ;
46
47
while let Ok ( reply) = replies. recv_async ( ) . await {
47
48
match reply. result ( ) {
48
49
Ok ( sample) => {
You can’t perform that action at this time.
0 commit comments