1
0
mirror of https://github.com/pcvolkmer/osc-variant.git synced 2025-04-19 19:56:50 +00:00

feat: add check for files with 'AnalyseBereichEditor'

This commit is contained in:
Paul-Christian Volkmer 2024-05-14 09:08:09 +02:00
parent 4fdfb97d75
commit cd2019332e

View File

@ -404,6 +404,16 @@ impl FromStr for OnkostarEditor {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
if !s
.matches("<AnalyseBereichEditor>")
.collect::<String>()
.is_empty()
{
return Err(
"Datei mit Inhalt 'AnalyseBereichEditor' kann nicht verwendet werden".into(),
);
}
match from_str::<OnkostarEditor>(s) {
Ok(profile) => Ok(profile),
Err(err) => Err(err.to_string()),