Skip to content
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

Merged
merged 4 commits into from
Aug 13, 2021
Merged

several changes for 0.4.0: #3

merged 4 commits into from
Aug 13, 2021

Conversation

jbr
Copy link
Owner

@jbr 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)]

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?

Copy link
Owner Author

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

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;

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]

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?

Copy link
Owner Author

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(),

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?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, that makes sense

@jbr jbr merged commit 4fd86a6 into main Aug 13, 2021
@delete-merged-branch delete-merged-branch bot deleted the proposed-v0.4.0 branch August 13, 2021 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants