fix metadata parsing with strange whitespace
All checks were successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
Mylloon 2023-12-22 15:57:30 +01:00
parent d6740851ec
commit bfd8467d14
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -206,7 +206,7 @@ pub fn read_file(filename: &str, expected_file: TypeFileMetadata) -> Option<File
/// Deserialize metadata based on a type
fn deserialize_metadata<T: Default + serde::de::DeserializeOwned>(text: &str) -> T {
serde_yaml::from_str(text.trim_matches(&['-', '\n'] as &[_])).unwrap_or_default()
serde_yaml::from_str(text.trim().trim_matches(&['-'] as &[_])).unwrap_or_default()
}
/// Fetch metadata from AST