Skip to content

Commit

Permalink
Update GitHub actions (#352)
Browse files Browse the repository at this point in the history
* Update GitHub actions

* Downgrade rust-toolchain to the latest stable version (1.74.0) from 1.80.0

* Fix issues with latest clippy

* Fix rustdoc check issue

* Update Rust toolchain in Dockerfile
  • Loading branch information
esteve authored Nov 28, 2023
1 parent 3c5cbfa commit 89eae65
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ jobs:
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Search packages in this repository
id: list_packages
run: |
echo ::set-output name=package_list::$(colcon list --names-only)
- name: Setup ROS environment
uses: ros-tooling/setup-ros@v0.6
uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
use-ros2-testing: ${{ matrix.ros_distribution == 'rolling' }}

- name: Setup Rust
uses: dtolnay/rust-toolchain@1.71.0
uses: dtolnay/rust-toolchain@1.74.0
with:
components: clippy, rustfmt

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

# Install Rust and the cargo-ament-build plugin
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.71.0 -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.74.0 -y
ENV PATH=/root/.cargo/bin:$PATH
RUN cargo install cargo-ament-build

Expand Down
9 changes: 4 additions & 5 deletions rclrs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,13 @@ pub fn create_node(context: &Context, node_name: &str) -> Result<Arc<Node>, Rclr
Node::new(context, node_name)
}

/// Creates a [`NodeBuilder`][1].
/// Creates a [`NodeBuilder`].
///
/// Convenience function equivalent to [`NodeBuilder::new()`][2] and [`Node::builder()`][3].
/// Convenience function equivalent to [`NodeBuilder::new()`][1] and [`Node::builder()`][2].
/// Please see that function's documentation.
///
/// [1]: crate::NodeBuilder
/// [2]: crate::NodeBuilder::new
/// [3]: crate::Node::builder
/// [1]: crate::NodeBuilder::new
/// [2]: crate::Node::builder
///
/// # Example
/// ```
Expand Down
2 changes: 1 addition & 1 deletion rosidl_runtime_rs/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ macro_rules! string_impl {

impl PartialOrd for $string {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.deref().partial_cmp(other.deref())
Some(self.cmp(other))
}
}

Expand Down
2 changes: 1 addition & 1 deletion rosidl_runtime_rs/src/string/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl Serialize for WString {
{
// Not particularly efficient
// SAFETY: See the Display implementation.
let u16_slice = unsafe { std::slice::from_raw_parts(self.data as *mut u16, self.size) };
let u16_slice = unsafe { std::slice::from_raw_parts(self.data, self.size) };
let s = std::string::String::from_utf16_lossy(u16_slice);
serializer.serialize_str(&s)
}
Expand Down

0 comments on commit 89eae65

Please sign in to comment.