Devolutions / mongodm-rs

A thin ODM layer for mongodb
30 stars 9 forks source link

Feature/strongly typed operators and pipelines #10

Closed Samuel-B-D closed 3 years ago

Samuel-B-D commented 3 years ago

Nice, thank you! New pipeline! macro is pretty neat.

I see how you did to make it work by separating "stringification" from type checks +1 I wonder if the number of arms in macro_rules! have significant influence on compile time. Since we use these a lot, it might be worth to separate @check and @string into separate helpers helper_field_stringify and helper_field_check (formerly we used to do the way you did because $crate didn't exist, now one can call helpers like $crate::helper_field_stringify!(…)). I'm not sure it's significant though; I'll check that tomorrow.

Also I spotted trailing spaces. I'm not sure why the pipeline is not running anymore but I suggest to run cargo fmt (even better if you run cargo +nightly fmt).

I agree there, also because it would not expose @string and @check to the outside.