Skip to content

Commit ab8223d

Browse files
committed
release 2.1
1 parent e535564 commit ab8223d

4 files changed

Lines changed: 33 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ especially the [Rust flavour](https://doc.rust-lang.org/cargo/reference/semver.h
1616

1717
### Removed
1818

19+
## [0.2.1] - 2025-09-24
20+
21+
### Added
22+
- `Debug` implementation for `Databoard`
23+
1924
## [0.2.0] - 2025-09-22
2025

2126
### Changed
22-
- hider inner structure, renamed `DataboardPtr` to `Databoard`
27+
- hide inner structure, renamed `DataboardPtr` to `Databoard`
2328

2429
### Fixed
2530
- minimum Rust version set to 1.88.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[package]
33
resolver = "3"
44
name = "databoard"
5-
version = "0.2.0"
5+
version = "0.2.1"
66
edition = "2024"
77
rust-version = "1.88.0"
88
license-file = "LICENSE"

src/database.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct Database {
2525

2626
impl core::fmt::Debug for Database {
2727
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
28-
write!(f, "Entries {{ [ ")?;
28+
write!(f, "Entries {{ [")?;
2929
let mut comma = false;
3030
for entry in &self.storage {
3131
if comma {
@@ -39,7 +39,7 @@ impl core::fmt::Debug for Database {
3939
let value = data.data().as_ref();
4040
write!(f, ", value: {value:?})")?;
4141
}
42-
write!(f, " ] }}")
42+
write!(f, "] }}")
4343
}
4444
}
4545

tests/debug.rs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ fn remappings() {
3434
#[test]
3535
fn databoard() {
3636
let mut databoard = Databoard::new();
37-
databoard.set("entry1", "value11").unwrap();
37+
databoard.set("entry1", "value1").unwrap();
3838
databoard.set("entry2", "value2").unwrap();
3939

4040
let databoard_string = format!("{:?}", &databoard);
4141
assert_eq!(
4242
databoard_string.as_str(),
43-
"Databoard { autoremap: false, Entries { [ (key: entry1, sequence_id: 1, value: Any { .. }), (key: entry2, sequence_id: 1, value: Any { .. }) ] }, Remappings { [] }, parent: None }"
43+
"Databoard { autoremap: false, Entries { [(key: entry1, sequence_id: 1, value: Any { .. }), (key: entry2, sequence_id: 1, value: Any { .. })] }, Remappings { [] }, parent: None }"
4444
);
4545

4646
let mut remappings = Remappings::default();
@@ -51,6 +51,27 @@ fn databoard() {
5151
let databoard_string = format!("{:?}", &databoard);
5252
assert_eq!(
5353
databoard_string.as_str(),
54-
"Databoard { autoremap: true, Entries { [ (key: entry1, sequence_id: 1, value: Any { .. }) ] }, Remappings { [(\"entry\", \"remapped\")] }, parent: None }"
54+
"Databoard { autoremap: true, Entries { [(key: entry1, sequence_id: 1, value: Any { .. })] }, Remappings { [(\"entry\", \"remapped\")] }, parent: None }"
55+
);
56+
57+
let parent = Databoard::new();
58+
let remappings = Remappings::default();
59+
let databoard = Databoard::with_parent(parent);
60+
61+
let databoard_string = format!("{:?}", &databoard);
62+
assert_eq!(
63+
databoard_string.as_str(),
64+
"Databoard { autoremap: true, Entries { [] }, Remappings { [] }, parent: Databoard { autoremap: false, Entries { [] }, Remappings { [] }, parent: None } }"
65+
);
66+
67+
let mut parent = Databoard::new();
68+
parent.set("p_entry", "p_value").unwrap();
69+
let mut remappings = Remappings::default();
70+
let mut databoard = Databoard::with_parent(parent);
71+
72+
let databoard_string = format!("{:?}", &databoard);
73+
assert_eq!(
74+
databoard_string.as_str(),
75+
"Databoard { autoremap: true, Entries { [] }, Remappings { [] }, parent: Databoard { autoremap: false, Entries { [(key: p_entry, sequence_id: 1, value: Any { .. })] }, Remappings { [] }, parent: None } }"
5576
);
5677
}

0 commit comments

Comments
 (0)