From c1e7f7264a68533262bfe1d181061e577e508030 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 12 Jan 2024 13:01:22 +0100 Subject: fix a condstore bug --- tests/common/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/common/mod.rs') diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 810fd79..cbe0271 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -88,3 +88,12 @@ pub fn read_lines<'a, F: Read>( println!("read: {}", std::str::from_utf8(&buffer[..nbytes])?); Ok(&buffer[..nbytes]) } + +pub fn read_first_u32(inp: &str) -> Result { + Ok(inp + .chars() + .skip_while(|c| !c.is_digit(10)) + .take_while(|c| c.is_digit(10)) + .collect::() + .parse::()?) +} -- cgit v1.2.3