diff --git a/src/error.rs b/src/error.rs index c5ebd2f..99c9eae 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,8 +22,13 @@ pub enum Error { /// Invalid number of arguments for the expression #[error("invalid number of arguments for {name}: {actual} (expected {expected})")] InvalidNumberOfArguments { + /// The name of the expression or operation name: String, + + /// The actual number of arguments actual: usize, + + /// The number of arguments the expression or operation expected expected: usize, }, diff --git a/src/expr.rs b/src/expr.rs index ef6bc86..49c6e85 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -19,6 +19,7 @@ use std::str::FromStr; /// and use [Expr::is_valid] to check validity. #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(untagged)] +#[allow(missing_docs)] pub enum Expr { Operation { op: String, args: Vec> }, Interval { interval: Vec> }, diff --git a/src/lib.rs b/src/lib.rs index e30df47..d0bb515 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,33 @@ //! Parse and transform [Common Query Language 2 (CQL2)](https://docs.ogc.org/is/21-065r2/21-065r2.html). -#![deny(unused_crate_dependencies)] +#![warn(missing_docs)] +#![deny( + elided_lifetimes_in_paths, + explicit_outlives_requirements, + keyword_idents, + macro_use_extern_crate, + meta_variable_misuse, + missing_abi, + missing_debug_implementations, + non_ascii_idents, + noop_method_call, + rust_2021_incompatible_closure_captures, + rust_2021_incompatible_or_patterns, + rust_2021_prefixes_incompatible_syntax, + rust_2021_prelude_collisions, + single_use_lifetimes, + trivial_casts, + trivial_numeric_casts, + unreachable_pub, + unsafe_code, + unsafe_op_in_unsafe_fn, + unused_crate_dependencies, + unused_extern_crates, + unused_import_braces, + unused_lifetimes, + unused_qualifications, + unused_results +)] mod error; mod expr; diff --git a/src/parser.rs b/src/parser.rs index e46639e..d162cd2 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -82,7 +82,7 @@ fn strip_quotes(s: &str) -> &str { } } -fn opstr(op: Pair) -> String { +fn opstr(op: Pair<'_, Rule>) -> String { return normalize_op(op.as_str()); } @@ -316,6 +316,6 @@ mod tests { #[test] fn point_zm() { - CQL2Parser::parse(Rule::GEOMETRY, "POINT ZM(-105.1019 40.1672 4981 42)").unwrap(); + let _ = CQL2Parser::parse(Rule::GEOMETRY, "POINT ZM(-105.1019 40.1672 4981 42)").unwrap(); } } diff --git a/src/validator.rs b/src/validator.rs index 4f382a6..667662b 100644 --- a/src/validator.rs +++ b/src/validator.rs @@ -3,6 +3,7 @@ use boon::{Compiler, SchemaIndex, Schemas, ValidationError}; use serde_json::Value; /// A re-usable json-schema validator for CQL2. +#[allow(missing_debug_implementations)] pub struct Validator { schemas: Schemas, index: SchemaIndex,