Skip to content

Commit c3eff64

Browse files
committed
[#865] Use core and alloc in iceoryx2-userland-record-and-replay
1 parent 51da520 commit c3eff64

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

iceoryx2-userland/record-and-replay/src/hex_conversion.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
//
1111
// SPDX-License-Identifier: Apache-2.0 OR MIT
1212

13+
use core::fmt::Write;
14+
15+
use alloc::string::String;
16+
use alloc::vec::Vec;
17+
1318
use iceoryx2_bb_log::debug;
1419

1520
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -46,8 +51,6 @@ pub fn hex_string_to_bytes(hex_string: &str) -> Result<Vec<u8>, HexToBytesConver
4651

4752
/// Converts bytes into a hex string. Can be converted back with [`hex_string_to_bytes()`].
4853
pub fn bytes_to_hex_string(raw_data: &[u8]) -> String {
49-
use std::fmt::Write;
50-
5154
let mut ret_val = String::with_capacity(3 * raw_data.len());
5255
for byte in raw_data {
5356
let _ = write!(&mut ret_val, "{byte:0>2x} ");

iceoryx2-userland/record-and-replay/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
//! # }
121121
//! ```
122122
123+
extern crate alloc;
124+
123125
/// Free functions to convert bytes to a hex string and back.
124126
pub mod hex_conversion;
125127

iceoryx2-userland/record-and-replay/src/record.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@
1010
//
1111
// SPDX-License-Identifier: Apache-2.0 OR MIT
1212

13-
use anyhow::Result;
1413
use core::time::Duration;
14+
15+
use alloc::format;
16+
use alloc::string::String;
17+
use alloc::vec;
18+
use alloc::vec::Vec;
19+
1520
use iceoryx2::service::static_config::message_type_details::TypeVariant;
1621
use iceoryx2_bb_log::fail;
1722
use iceoryx2_bb_posix::file::{File, FileReadLineState};
1823

24+
use anyhow::Result;
25+
1926
use crate::{
2027
hex_conversion::{bytes_to_hex_string, hex_string_to_bytes},
2128
record_header::RecordHeaderDetails,

iceoryx2-userland/record-and-replay/src/recorder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
//! # }
5252
//! ```
5353
54+
use alloc::format;
55+
5456
use iceoryx2::prelude::{MessagingPattern, ServiceName};
5557
use iceoryx2::service::static_config::message_type_details::{TypeDetail, TypeVariant};
5658
use iceoryx2_bb_elementary::package_version::PackageVersion;

iceoryx2-userland/record-and-replay/src/replayer.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
//! ```
7474
7575
use core::mem::MaybeUninit;
76+
77+
use alloc::vec;
78+
use alloc::vec::Vec;
79+
7680
use iceoryx2_bb_log::fail;
7781
use iceoryx2_bb_posix::file::AccessMode;
7882
use iceoryx2_bb_posix::file::File;

0 commit comments

Comments
 (0)