From aaccfb8d0e6af66b1247a99b4f063c18a1eec7ee Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 20 Nov 2024 01:02:48 +0100 Subject: [PATCH] don't crash on empty file --- src/utils/metadata.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/metadata.rs b/src/utils/metadata.rs index 0bf3606..80ba9c5 100644 --- a/src/utils/metadata.rs +++ b/src/utils/metadata.rs @@ -159,5 +159,5 @@ pub fn get<'a>(root: &'a AstNode<'a>, mtype: MType) -> MFile { }, }) .next() - .unwrap() + .unwrap_or_default() }