-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is_some() cannot be followed by has_length() #11
Comments
At the same time assert_that(&Some(vec![1,2,3])).is_some().has_length(5); works as expected, so my issues is somewhere in spectral+serde combination... |
Well, assert_that(&Some(&vec![1,2,3])).is_some().has_length(5); fails in the same way as my original one did. So the issue is with that additional reference inside of Looks like this is an additional, not yet implemented feature. Should I keep this issue open then? |
Looks like it's missing an implementation for &Vec. I guess I never thought of the case where you'd be unwrapping a reference to a Vec via Simple solution would be to just copy-paste the existing implementation with the new bound, but it'd be nice to just use a macro or something to clean it up a bit. I'm happy to wait for you to submit a PR, or otherwise I'm also happy to fix it up when I have a moment. |
I'm trying to build some assertions on
serde_json::Value
(parsing result from my JSON-RPC api).I'm doing this:
and expect it to work, since
is_some()
returnsSpec
over the contained object.Surprisingly, I'm getting an error:
What am I doing wrong here?
PS. I'm on Rust 1.16 stable, on Windows (
stable-x86_64-pc-windows-msvc
).Spectral version is 0.6.0, installed from crates.
The text was updated successfully, but these errors were encountered: