Skip to content

Commit 2baa4a8

Browse files
committed
fix: fix format
Signed-off-by: Esteve Fernandez <esteve@apache.org>
1 parent bcd9712 commit 2baa4a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+629
-575
lines changed

rclrs/src/action.rs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub use action_goal_receiver::*;
99
pub(crate) mod action_server;
1010
pub use action_server::*;
1111

12-
use crate::{log_error, rcl_bindings::*, vendor::builtin_interfaces::msg::Time, DropGuard};
12+
use crate::{DropGuard, log_error, rcl_bindings::*, vendor::builtin_interfaces::msg::Time};
1313
use std::fmt;
1414

1515
#[cfg(feature = "serde")]
@@ -31,24 +31,26 @@ impl GoalUuid {
3131

3232
impl fmt::Display for GoalUuid {
3333
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
34-
write!(f, "{:02x}{:02x}{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
35-
self.0[0],
36-
self.0[1],
37-
self.0[2],
38-
self.0[3],
39-
self.0[4],
40-
self.0[5],
41-
self.0[6],
42-
self.0[7],
43-
self.0[8],
44-
self.0[9],
45-
self.0[10],
46-
self.0[11],
47-
self.0[12],
48-
self.0[13],
49-
self.0[14],
50-
self.0[15],
51-
)
34+
write!(
35+
f,
36+
"{:02x}{:02x}{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
37+
self.0[0],
38+
self.0[1],
39+
self.0[2],
40+
self.0[3],
41+
self.0[4],
42+
self.0[5],
43+
self.0[6],
44+
self.0[7],
45+
self.0[8],
46+
self.0[9],
47+
self.0[10],
48+
self.0[11],
49+
self.0[12],
50+
self.0[13],
51+
self.0[14],
52+
self.0[15],
53+
)
5254
}
5355
}
5456

rclrs/src/action/action_client.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use super::empty_goal_status_array;
22
use crate::{
3-
log_warn,
3+
CancelResponse, CancelResponseCode, DropGuard, ENTITY_LIFECYCLE_MUTEX, GoalStatus,
4+
GoalStatusCode, GoalUuid, MultiCancelResponse, Node, NodeHandle, QoSProfile, RclPrimitive,
5+
RclPrimitiveHandle, RclPrimitiveKind, RclrsError, ReadyKind, TakeFailedAsNone, ToResult,
6+
Waitable, WaitableLifecycle, log_warn,
47
rcl_bindings::*,
58
vendor::{action_msgs::srv::CancelGoal_Response, builtin_interfaces::msg::Time},
6-
CancelResponse, CancelResponseCode, DropGuard, GoalStatus, GoalStatusCode, GoalUuid,
7-
MultiCancelResponse, Node, NodeHandle, QoSProfile, RclPrimitive, RclPrimitiveHandle,
8-
RclPrimitiveKind, RclrsError, ReadyKind, TakeFailedAsNone, ToResult, Waitable,
9-
WaitableLifecycle, ENTITY_LIFECYCLE_MUTEX,
109
};
1110
use rosidl_runtime_rs::{Action, Message, RmwFeedbackMessage, RmwGoalResponse, RmwResultResponse};
1211
use std::{
@@ -17,8 +16,8 @@ use std::{
1716
sync::{Arc, Mutex, MutexGuard, Weak},
1817
};
1918
use tokio::sync::{
20-
mpsc::{unbounded_channel, UnboundedSender},
21-
oneshot::{channel as oneshot_channel, Sender},
19+
mpsc::{UnboundedSender, unbounded_channel},
20+
oneshot::{Sender, channel as oneshot_channel},
2221
watch::Sender as WatchSender,
2322
};
2423

rclrs/src/action/action_client/goal_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
2-
vendor::builtin_interfaces::msg::Time, CancellationClient, FeedbackClient, GoalStatus,
3-
GoalStatusCode, ResultClient, StatusWatcher,
2+
CancellationClient, FeedbackClient, GoalStatus, GoalStatusCode, ResultClient, StatusWatcher,
3+
vendor::builtin_interfaces::msg::Time,
44
};
55
use rosidl_runtime_rs::Action;
66
use std::{

rclrs/src/action/action_client/result_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::GoalClientLifecycle;
22
use crate::GoalStatusCode;
3-
use futures::{future::Shared, FutureExt};
3+
use futures::{FutureExt, future::Shared};
44
use rosidl_runtime_rs::Action;
55
use std::{
66
future::Future,

rclrs/src/action/action_goal_receiver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88
ops::{Deref, DerefMut},
99
sync::Arc,
1010
};
11-
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver};
11+
use tokio::sync::mpsc::{UnboundedReceiver, unbounded_channel};
1212

1313
/// This is an alternative tool for implementing an [`ActionServer`]. Instead of
1414
/// specifying a callback to receive goal requests, you can use this receiver to

rclrs/src/action/action_server.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use super::empty_goal_status_array;
22
use crate::{
3-
action::GoalUuid, error::ToResult, rcl_bindings::*,
4-
vendor::action_msgs::srv::CancelGoal_Response, ActionGoalReceiver, CancelResponseCode,
5-
DropGuard, GoalStatusCode, Node, NodeHandle, QoSProfile, RclPrimitive, RclPrimitiveHandle,
6-
RclPrimitiveKind, RclrsError, ReadyKind, TakeFailedAsNone, Waitable, WaitableLifecycle,
7-
ENTITY_LIFECYCLE_MUTEX,
3+
ActionGoalReceiver, CancelResponseCode, DropGuard, ENTITY_LIFECYCLE_MUTEX, GoalStatusCode,
4+
Node, NodeHandle, QoSProfile, RclPrimitive, RclPrimitiveHandle, RclPrimitiveKind, RclrsError,
5+
ReadyKind, TakeFailedAsNone, Waitable, WaitableLifecycle, action::GoalUuid, error::ToResult,
6+
rcl_bindings::*, vendor::action_msgs::srv::CancelGoal_Response,
87
};
98
use futures::future::BoxFuture;
109
use rosidl_runtime_rs::{Action, Message, RmwGoalRequest, RmwResultRequest};

rclrs/src/action/action_server/action_server_goal_handle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::GoalStatusCode;
22
use crate::{
3-
log_error, rcl_bindings::*, ActionServerHandle, GoalUuid, RclErrorMsg, RclReturnCode,
4-
RclrsError, ToResult,
3+
ActionServerHandle, GoalUuid, RclErrorMsg, RclReturnCode, RclrsError, ToResult, log_error,
4+
rcl_bindings::*,
55
};
66
use rosidl_runtime_rs::{Action, RmwResultResponse};
77
use std::sync::{Mutex, MutexGuard};

rclrs/src/action/action_server/cancellation_state.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
use super::ActionServerHandle;
22
use crate::{
3-
log_error,
3+
CancelResponseCode, GoalUuid, Node, RclrsErrorFilter, ToResult, log_error,
44
rcl_bindings::*,
55
vendor::{
66
action_msgs::{msg::GoalInfo, srv::CancelGoal_Response},
77
unique_identifier_msgs::msg::UUID,
88
},
9-
CancelResponseCode, GoalUuid, Node, RclrsErrorFilter, ToResult,
109
};
1110
use futures::{
12-
future::{select, Either},
11+
future::{Either, select},
1312
pin_mut,
1413
};
1514
use futures_lite::future::race;
@@ -20,7 +19,7 @@ use std::{
2019
future::Future,
2120
sync::{Arc, Mutex},
2221
};
23-
use tokio::sync::watch::{channel as watch_channel, Receiver, Sender};
22+
use tokio::sync::watch::{Receiver, Sender, channel as watch_channel};
2423

2524
pub(super) struct CancellationState<A: Action> {
2625
receiver: Receiver<bool>,

rclrs/src/action/action_server/live_action_server_goal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::{
22
ActionServerGoalHandle, ActionServerHandle, CancellationRequest, CancellationState,
33
GoalStatusCode, TerminalStatus,
44
};
5-
use crate::{log_error, rcl_bindings::*, RclrsError, ToResult};
5+
use crate::{RclrsError, ToResult, log_error, rcl_bindings::*};
66
use rosidl_runtime_rs::{Action, Message};
77
use std::{borrow::Cow, ops::Deref, sync::Arc};
88

rclrs/src/action/action_server/requested_goal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::{
22
AcceptedGoal, ActionServerGoalBoard, ActionServerGoalHandle, LiveActionServerGoal,
33
TerminatedGoal,
44
};
5-
use crate::{log_error, rcl_bindings::*, GoalUuid, RclrsError, RclrsErrorFilter, ToResult};
5+
use crate::{GoalUuid, RclrsError, RclrsErrorFilter, ToResult, log_error, rcl_bindings::*};
66
use rosidl_runtime_rs::Action;
77
use std::sync::Arc;
88

0 commit comments

Comments
 (0)