From 52deb7c4a8ed0a3714abe10c6d532e34f784f86c Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 28 Sep 2020 13:37:49 +0200 Subject: add Log::build_id --- src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 9e605d8..60b404c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -915,4 +915,16 @@ impl Log { }) .collect() } + + /// Returns the game's build id. + /// + /// If no build id was found, `None` is returned. + pub fn build_id(&self) -> Option { + for event in self.events() { + if let EventKind::Build { build } = event.kind() { + return Some(*build) + } + } + None + } } -- cgit v1.2.3