fixes
This commit is contained in:
parent
2844e68a88
commit
2a268bb5cd
1 changed files with 12 additions and 2 deletions
14
src/main.rs
14
src/main.rs
|
@ -37,7 +37,13 @@ pub fn get_frontmatter(markdown: &str) -> Option<String> {
|
|||
|
||||
fn require_everything(schema: &mut serde_json::Value) {
|
||||
if let Some(schema_obj) = schema.as_object_mut() {
|
||||
if schema_obj.get("type").unwrap().as_str().unwrap() == "object" {
|
||||
if match schema_obj.get("type").unwrap() {
|
||||
serde_json::Value::String(str) => str == "object",
|
||||
serde_json::Value::Array(lst) => {
|
||||
lst.contains(&serde_json::Value::String("object".into()))
|
||||
}
|
||||
_ => false,
|
||||
} {
|
||||
let keys: Vec<_> = schema_obj
|
||||
.get("properties")
|
||||
.unwrap()
|
||||
|
@ -99,7 +105,11 @@ fn main() {
|
|||
|
||||
//println!("{file}: {:#?}", error);
|
||||
|
||||
let file = Style::new().blue().apply_to(file);
|
||||
let file = Style::new().blue().apply_to(if file.contains(' ') {
|
||||
format!("\"{file}\"")
|
||||
} else {
|
||||
file.to_string()
|
||||
});
|
||||
let path = Style::new().bright().red().apply_to(path);
|
||||
|
||||
match error.kind {
|
||||
|
|
Loading…
Reference in a new issue