From eeb79ef0903045ee027ced7aaece0ac59399841a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 31 Jul 2024 18:26:53 +0300 Subject: [PATCH] feat(src/msg.rs): add RunId::as_str method This makes it easier to use the run ID as a string, without creating a whole new String value. Signed-off-by: Lars Wirzenius --- src/msg.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/msg.rs b/src/msg.rs index bbb06976..d23f843d 100644 --- a/src/msg.rs +++ b/src/msg.rs @@ -77,6 +77,13 @@ impl fmt::Display for RunId { } } +impl RunId { + /// Return representation of identifier as a string slice. + pub fn as_str(&self) -> &str { + &self.id + } +} + /// The result of a CI run. #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields)]