Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nightly for style check #396

Merged
merged 5 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ jobs:
run: |
for path in $(colcon list | awk '$3 == "(ament_cargo)" { print $2 }'); do
cd $path
cargo fmt -- --check
rustup toolchain install nightly
cargo +nightly fmt -- --check
cd -
done

Expand Down
4 changes: 1 addition & 3 deletions examples/message_demo/src/message_demo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use std::convert::TryInto;
use std::env;
use std::sync::Arc;
use std::{convert::TryInto, env, sync::Arc};

use anyhow::{Error, Result};
use rosidl_runtime_rs::{seq, BoundedSequence, Message, Sequence};
Expand Down
10 changes: 7 additions & 3 deletions examples/minimal_pub_sub/src/minimal_two_nodes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use std::env;
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::{Arc, Mutex};
use std::{
env,
sync::{
atomic::{AtomicU32, Ordering},
Arc, Mutex,
},
};

use anyhow::{Error, Result};

Expand Down
12 changes: 7 additions & 5 deletions rosidl_runtime_rs/src/sequence.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use std::cmp::Ordering;
use std::fmt::{self, Debug, Display};
use std::hash::{Hash, Hasher};
use std::iter::{Extend, FromIterator, FusedIterator};
use std::ops::{Deref, DerefMut};
use std::{
cmp::Ordering,
fmt::{self, Debug, Display},
hash::{Hash, Hasher},
iter::{Extend, FromIterator, FusedIterator},
ops::{Deref, DerefMut},
};

#[cfg(feature = "serde")]
mod serde;
Expand Down
15 changes: 8 additions & 7 deletions rosidl_runtime_rs/src/string.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use std::cmp::Ordering;
use std::ffi::CStr;
use std::fmt::{self, Debug, Display};
use std::hash::{Hash, Hasher};
use std::ops::{Deref, DerefMut};
use std::{
cmp::Ordering,
ffi::CStr,
fmt::{self, Debug, Display},
hash::{Hash, Hasher},
ops::{Deref, DerefMut},
};

#[cfg(feature = "serde")]
mod serde;

use crate::sequence::Sequence;
use crate::traits::SequenceAlloc;
use crate::{sequence::Sequence, traits::SequenceAlloc};

/// A zero-terminated UTF-8 string.
///
Expand Down
3 changes: 1 addition & 2 deletions rosidl_runtime_rs/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
// DISTRIBUTION A. Approved for public release; distribution unlimited.
// OPSEC #4584.
//
use std::borrow::Cow;
use std::fmt::Debug;
use std::{borrow::Cow, fmt::Debug};

/// Internal trait that connects a particular `Sequence<T>` instance to generated C functions
/// that allocate and deallocate memory.
Expand Down
Loading