-
Notifications
You must be signed in to change notification settings - Fork 3
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
several changes for 0.4.0: #3
Conversation
jbr
commented
Aug 11, 2021
- add support for dots
- slight perf improvement through use of smartstring
- removes reverse match, replaces it with Route::template
* add support for dots * slight perf improvement through use of smartstring * removes reverse match, replaces it with Route::template
@@ -1,10 +1,13 @@ | |||
#![forbid(unsafe_code, future_incompatible)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer if this was instead moved into deny
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future incompatible is warn by default and that seems reasonable. I've been trying to standardize my default set of lints across projects, so this was just pasting in my updated version. I can't remember why I took out forbid future incompatible at some point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably because of rust-lang/rust#81670
@@ -1,4 +1,5 @@ | |||
use crate::Segment; | |||
use crate::{Captures, Match, ReverseMatch, Segment}; | |||
use smartstring::alias::String as SmartString; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh neat
} | ||
|
||
/// Returns a vec of captured str slices for this routespec | ||
#[inline] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this really the right choice here and/or above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah these were both driven by the criterion benches. I don't have enough confidence in my understanding of rustc to add something like this without before/after benchmarks. It helped a statistically significant amount
src/route.rs
Outdated
fn from(segments: Vec<Segment>) -> Self { | ||
Self { | ||
segments, | ||
source: SmartString::new(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not used for display and whatnot? I.e. should this reverse build this string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, that makes sense