From 259cb37a8ac6ff4d7d8ea642d28387521ddd567a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Nerma?= Date: Wed, 6 Dec 2023 13:47:57 +0100 Subject: [PATCH 1/2] Allow to build HistoryItemId values from the outside --- src/history/item.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/history/item.rs b/src/history/item.rs index ec477bbc..ca60d49d 100644 --- a/src/history/item.rs +++ b/src/history/item.rs @@ -6,9 +6,10 @@ use std::{fmt::Display, time::Duration}; /// Unique ID for the [`HistoryItem`]. More recent items have higher ids than older ones. #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub struct HistoryItemId(pub(crate) i64); +pub struct HistoryItemId(pub i64); + impl HistoryItemId { - pub(crate) const fn new(i: i64) -> HistoryItemId { + pub const fn new(i: i64) -> HistoryItemId { HistoryItemId(i) } } From 349de6c0dc56d4314b790f8e9a30ba2c66540f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Nerma?= Date: Wed, 6 Dec 2023 14:19:33 +0100 Subject: [PATCH 2/2] Fix: add missing documentation on HistoryItemId::new --- src/history/item.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/history/item.rs b/src/history/item.rs index ca60d49d..3696f3c7 100644 --- a/src/history/item.rs +++ b/src/history/item.rs @@ -9,6 +9,7 @@ use std::{fmt::Display, time::Duration}; pub struct HistoryItemId(pub i64); impl HistoryItemId { + /// Create a new `HistoryItemId` value pub const fn new(i: i64) -> HistoryItemId { HistoryItemId(i) }