Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ark0f committed Nov 23, 2024
1 parent 0c4ccd4 commit 43dadbf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gcore/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ impl AsRawPtr for ReservationId {}
/// Extensions for additional features.
pub mod ext {
use crate::stack_buffer;
use core::{fmt, fmt::Write as _, mem::MaybeUninit};
use core::{
fmt::{self, Write as _},
mem::MaybeUninit,
};
use gear_stack_buffer::MAX_BUFFER_SIZE;

/// Add a `data` string to the debug log.
Expand All @@ -63,6 +66,7 @@ pub mod ext {
///
/// Note: message size is limited to
/// [`MAX_BUFFER_SIZE`](crate::stack_buffer::MAX_BUFFER_SIZE).
/// Message is truncated if it exceeds maximum buffer size.
#[cfg(any(feature = "debug", debug_assertions))]
pub fn stack_debug(args: fmt::Arguments<'_>) {
struct StackFmtWriter<'a> {
Expand Down Expand Up @@ -152,7 +156,11 @@ pub mod ext {

/// Add a debug message to the log.
///
/// Same as `gstd::debug!()` but uses a stack-allocated buffer.
/// Same as `gstd::debug!()` but uses [`ext::stack_debug`] underneath.
///
/// Note: message size is limited to
/// [`MAX_BUFFER_SIZE`](crate::stack_buffer::MAX_BUFFER_SIZE).
/// Message is truncated if it exceeds maximum buffer size.
///
/// # Examples
///
Expand Down

0 comments on commit 43dadbf

Please sign in to comment.