Skip to content

Commit e341758

Browse files
committed
fix: doc tests
1 parent ac08fe8 commit e341758

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

crates/stackable-operator/src/v2/macros/attributed_string_type.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ impl Regex {
7373
///
7474
/// # Examples
7575
///
76-
/// ```ignore
76+
/// ```rust
77+
/// use std::str::FromStr;
78+
///
79+
/// use stackable_operator::attributed_string_type;
7780
/// attributed_string_type! {
7881
/// ConfigMapName,
7982
/// "The name of a ConfigMap",
@@ -451,7 +454,8 @@ macro_rules! attributed_string_type {
451454
///
452455
/// # Examples
453456
///
454-
/// ```ignore
457+
/// ```rust
458+
/// use stackable_operator::v2::macros::attributed_string_type::min;
455459
/// assert_eq!(2, min(2, 3));
456460
/// assert_eq!(4, min(5, 4));
457461
/// assert_eq!(1, min(1, 1));
@@ -466,7 +470,8 @@ pub const fn min(x: usize, y: usize) -> usize {
466470
///
467471
/// # Examples
468472
///
469-
/// ```ignore
473+
/// ```rust
474+
/// use stackable_operator::{attributed_string_type, v2::macros::attributed_string_type::max};
470475
/// assert_eq!(3, max(2, 3));
471476
/// assert_eq!(5, max(5, 4));
472477
/// assert_eq!(1, max(1, 1));

crates/stackable-operator/src/v2/macros/constant.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
///
55
/// # Examples
66
///
7-
/// ```ignore
7+
/// ```rust
8+
/// use std::str::FromStr;
9+
///
10+
/// use stackable_operator::constant;
11+
/// use stackable_operator::v2::types::kubernetes::VolumeName;
812
/// constant!(DATA_VOLUME_NAME: VolumeName = "data");
913
/// constant!(pub CONFIG_VOLUME_NAME: VolumeName = "config");
1014
/// ```

0 commit comments

Comments
 (0)