From 340af01227c68cdb81525263c6cf08bc3ca2ce07 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sun, 18 Sep 2022 14:08:23 +0100 Subject: [PATCH] Ensure is::uuid() function returns expected result Closes #210 --- lib/src/fnc/is.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/fnc/is.rs b/lib/src/fnc/is.rs index e5bcd1e2..12ec7fbe 100644 --- a/lib/src/fnc/is.rs +++ b/lib/src/fnc/is.rs @@ -62,7 +62,11 @@ pub fn semver(_: &Context, mut args: Vec) -> Result { #[inline] pub fn uuid(_: &Context, mut args: Vec) -> Result { - Ok(Uuid::parse_str(args.remove(0).as_string().as_str()).is_ok().into()) + Ok(match args.remove(0) { + Value::Strand(v) => Uuid::parse_str(v.as_string().as_str()).is_ok().into(), + Value::Uuid(_) => true.into(), + _ => false.into(), + }) } #[cfg(test)]