diff --git a/Makefile b/Makefile index 0258fd0..92d229e 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ view: precommit: rustup update cargo update + cargo check cargo fmt cargo t cargo clippy --fix --allow-dirty diff --git a/src/utils.rs b/src/utils.rs index fae4fd8..bab9afa 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -144,13 +144,16 @@ impl CreateVersion { for line in lines { let json: Value = from_str(&line).expect("Failed to parse JSON"); - let data = Entity::from_json(json).expect("Failed to parse JSON"); + let data = match Entity::from_json(json) { + Ok(data) => data, + Err(_) => continue, + }; let (claims, data) = EntityMini::from_entity(data); match data.id.clone().expect("No ID").tb.as_str() { "Property" => property_vec.push(data), "Lexeme" => lexeme_vec.push(data), "Entity" => entity_vec.push(data), - _ => panic!("Unknown table"), + _ => continue, } claims_vec.push(claims); }