Skip to content

Commit 0e6939c

Browse files
GuelakaisGueLaKais
andauthored
Fixup of #388 (#389)
* adde .rustfmt.toml to main repository folder * added rust_formatter.sh * added content to the rust_formatter.sh * removed rust_formatter.sh for better performance * modechange * Run rustfmt Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai> * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` * Run rustfmt Does change the things described in the newly added `.rustfmt.toml` --------- Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai> Co-authored-by: GueLaKais <koroyeldores@gmail.com>
1 parent 646869b commit 0e6939c

27 files changed

+156
-138
lines changed

.rustfmt.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports_granularity = "Crate"
2+

rclrs/build.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
use std::env;
2-
use std::fs::read_dir;
3-
use std::path::{Path, PathBuf};
1+
use std::{
2+
env,
3+
fs::read_dir,
4+
path::{Path, PathBuf},
5+
};
46

57
const AMENT_PREFIX_PATH: &str = "AMENT_PREFIX_PATH";
68
const ROS_DISTRO: &str = "ROS_DISTRO";

rclrs/src/arguments.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use std::ffi::CString;
2-
use std::os::raw::c_char;
3-
use std::os::raw::c_void;
4-
use std::ptr::null_mut;
1+
use std::{
2+
ffi::CString,
3+
os::raw::{c_char, c_void},
4+
ptr::null_mut,
5+
};
56

6-
use crate::error::*;
7-
use crate::rcl_bindings::*;
7+
use crate::{error::*, rcl_bindings::*};
88

99
/// Extract non-ROS arguments from program's input arguments.
1010
///

rclrs/src/client.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
use std::boxed::Box;
2-
use std::collections::HashMap;
3-
use std::ffi::CString;
4-
use std::sync::atomic::AtomicBool;
5-
use std::sync::{Arc, Mutex, MutexGuard};
1+
use std::{
2+
boxed::Box,
3+
collections::HashMap,
4+
ffi::CString,
5+
sync::{atomic::AtomicBool, Arc, Mutex, MutexGuard},
6+
};
67

78
use futures::channel::oneshot;
89
use rosidl_runtime_rs::Message;
910

10-
use crate::error::{RclReturnCode, ToResult};
11-
use crate::MessageCow;
12-
use crate::{rcl_bindings::*, NodeHandle, RclrsError, ENTITY_LIFECYCLE_MUTEX};
11+
use crate::{
12+
error::{RclReturnCode, ToResult},
13+
rcl_bindings::*,
14+
MessageCow, NodeHandle, RclrsError, ENTITY_LIFECYCLE_MUTEX,
15+
};
1316

1417
// SAFETY: The functions accessing this type, including drop(), shouldn't care about the thread
1518
// they are running in. Therefore, this type can be safely sent to another thread.

rclrs/src/clock.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use crate::rcl_bindings::*;
2-
use crate::{error::ToResult, time::Time, to_rclrs_result};
1+
use crate::{error::ToResult, rcl_bindings::*, time::Time, to_rclrs_result};
32
use std::sync::{Arc, Mutex};
43

54
/// Enum to describe clock type. Redefined for readability and to eliminate the uninitialized case

rclrs/src/context.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
use std::ffi::CString;
2-
use std::os::raw::c_char;
3-
use std::string::String;
4-
use std::sync::{Arc, Mutex};
5-
use std::vec::Vec;
1+
use std::{
2+
ffi::CString,
3+
os::raw::c_char,
4+
string::String,
5+
sync::{Arc, Mutex},
6+
vec::Vec,
7+
};
68

7-
use crate::rcl_bindings::*;
8-
use crate::{RclrsError, ToResult};
9+
use crate::{rcl_bindings::*, RclrsError, ToResult};
910

1011
/// This is locked whenever initializing or dropping any middleware entity
1112
/// because we have found issues in RCL and some RMW implementations that

rclrs/src/dynamic_message.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
//!
66
//! The central type of this module is [`DynamicMessage`].
77
8-
use std::fmt::{self, Display};
9-
use std::path::PathBuf;
10-
use std::sync::Arc;
8+
use std::{
9+
fmt::{self, Display},
10+
path::PathBuf,
11+
sync::Arc,
12+
};
1113

12-
use crate::rcl_bindings::rosidl_typesupport_introspection_c__MessageMembers_s as rosidl_message_members_t;
13-
use crate::rcl_bindings::*;
14+
use crate::rcl_bindings::{
15+
rosidl_typesupport_introspection_c__MessageMembers_s as rosidl_message_members_t, *,
16+
};
1417

1518
mod error;
1619
pub use error::*;

rclrs/src/dynamic_message/error.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::error::Error;
2-
use std::fmt;
1+
use std::{error::Error, fmt};
32

43
/// An error related to creating a dynamic message based on the name of the message's type.
54
#[derive(Debug)]

rclrs/src/error.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
use std::error::Error;
2-
use std::ffi::{CStr, NulError};
3-
use std::fmt::{self, Display};
1+
use std::{
2+
error::Error,
3+
ffi::{CStr, NulError},
4+
fmt::{self, Display},
5+
};
46

57
use crate::rcl_bindings::*;
68

rclrs/src/executor.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use crate::rcl_bindings::rcl_context_is_valid;
2-
use crate::{Node, RclReturnCode, RclrsError, WaitSet};
3-
use std::sync::{Arc, Mutex, Weak};
4-
use std::time::Duration;
1+
use crate::{rcl_bindings::rcl_context_is_valid, Node, RclReturnCode, RclrsError, WaitSet};
2+
use std::{
3+
sync::{Arc, Mutex, Weak},
4+
time::Duration,
5+
};
56

67
/// Single-threaded executor implementation.
78
pub struct SingleThreadedExecutor {

0 commit comments

Comments
 (0)