diff --git a/.idea/runConfigurations/Run__dry_.xml b/.idea/runConfigurations/Run__dry_.xml
index 4fd01b9..4f00742 100644
--- a/.idea/runConfigurations/Run__dry_.xml
+++ b/.idea/runConfigurations/Run__dry_.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/src/config.rs b/src/config.rs
index f831bde..6b4ca81 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -2,8 +2,9 @@ use std::borrow::ToOwned;
use std::fs;
use std::fs::File;
use std::io::{ErrorKind, Read, Write};
+use std::path::Path;
-use anyhow::{anyhow, bail, Context, Result};
+use anyhow::{bail, Context, Result};
use rand::distributions::Alphanumeric;
use rand::Rng;
use regex::Regex;
@@ -48,10 +49,10 @@ pub struct Config {
}
fn validate_unique_id(value: &str) -> Result<(), ValidationError> {
- if Regex::new(r"^[a-zA-Z0-9]+(_[a-zA-Z0-9])*$").unwrap().is_match(value) {
+ if Regex::new(r"^[a-zA-Z0-9]+(_[a-zA-Z0-9]+)*$").unwrap().is_match(value) {
Ok(())
} else {
- Err(ValidationError::new("invalid_unique_id"))
+ Err(ValidationError::new("does not match regex"))
}
}
@@ -75,37 +76,32 @@ fn create_example_config() -> Config {
}
}
-pub fn load() -> Result