Closed caspark closed 7 years ago
Seems like I've managed to wrangle the Travis CI config to test both with the specialized feature switched on and off on nightly while stable and beta trains of Rust have the feature switched off.
Depending on your inclinations, you might want to tweak things a little further to make sure the feature is on for calculating code coverage or similar, and I suspect that deploy_gh_pages.sh
also needs a check to make sure the docs are only published from (I suggest) the stable Rust build job.
Awesome! Thanks for doing this! I'm glad to see that specialization is actually helping out quite a bit here.
I've been thinking about just moving the docs for this crate over to docs.rs anyways, so now seems like a good time to do that :)
Great! Thanks for the quick review & merge. Once you've got the docs publishing sorted out, would you push up a release to crates.io please?
Everything should all be sorted out now, and I pushed up 0.1.1
to crates.io: https://crates.io/crates/jmespath/0.1.1
Great, thank you!
The meat of this change is putting the usage of specialization behind a
specialized
feature flag, such that on stable Rust this library always usesimpl<'a, T: ser::Serialize> ToJmespath for T
.After I did that, I needed to tweak some of the imports, as (for reasons I don't quite understand) nightly Rust treats imports slightly differently than stable Rust does.
Benchmarks (on
rustc 1.16.0-nightly (6f1ae663e 2017-01-06)
) show the version without specialization is between 2-10x slower.But I'd rather have code running 2-10x slower than not be able to use the functionality at all in my project :)