v0.12.0-preety_code
This commit is contained in:
@@ -226,7 +226,10 @@ fn main() {
|
||||
.file_stem()
|
||||
.and_then(|value| value.to_str())
|
||||
.expect("UTF-8 preset id");
|
||||
if !stem.chars().all(|ch| ch.is_ascii_alphanumeric() || ch == '-' || ch == '_') {
|
||||
if !stem
|
||||
.chars()
|
||||
.all(|ch| ch.is_ascii_alphanumeric() || ch == '-' || ch == '_')
|
||||
{
|
||||
panic!("{filename}: filename may only contain ASCII letters, digits, '-' and '_'");
|
||||
}
|
||||
let source = fs::read_to_string(&path)
|
||||
@@ -260,7 +263,9 @@ fn main() {
|
||||
.get("flow")
|
||||
.and_then(Value::as_object)
|
||||
.unwrap_or_else(|| panic!("{filename}: flow must be an object"));
|
||||
if !flow.get("nodes").is_some_and(Value::is_array) || !flow.get("edges").is_some_and(Value::is_array) {
|
||||
if !flow.get("nodes").is_some_and(Value::is_array)
|
||||
|| !flow.get("edges").is_some_and(Value::is_array)
|
||||
{
|
||||
panic!("{filename}: flow.nodes and flow.edges must be arrays");
|
||||
}
|
||||
preset_manifest.push(json!({
|
||||
|
||||
Reference in New Issue
Block a user