Skip to content

Commit

Permalink
remove transitive dashmap dependency
Browse files Browse the repository at this point in the history
closes #2747
  • Loading branch information
robjtede committed Jun 11, 2022
1 parent 236601d commit 5377130
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 263 deletions.
2 changes: 1 addition & 1 deletion actix-files/CHANGES.md
Expand Up @@ -4,7 +4,7 @@
- Add `NamedFile::{modified, metadata, content_type, content_disposition, encoding}()` getters. [#2021]
- Update `tokio-uring` dependency to `0.3`.
- Audio files now use `Content-Disposition: inline` instead of `attachment`. [#2645]
- Minimum supported Rust version (MSRV) is now 1.56.
- Minimum supported Rust version (MSRV) is now 1.56 due to transitive `hashbrown` dependency.

[#2021]: https://github.com/actix/actix-web/pull/2021
[#2645]: https://github.com/actix/actix-web/pull/2645
Expand Down
2 changes: 1 addition & 1 deletion actix-http-test/CHANGES.md
@@ -1,7 +1,7 @@
# Changes

## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.56.
- Minimum supported Rust version (MSRV) is now 1.56 due to transitive `hashbrown` dependency.


## 3.0.0-beta.13 - 2022-02-16
Expand Down
2 changes: 1 addition & 1 deletion actix-http/CHANGES.md
Expand Up @@ -2,7 +2,7 @@

## Unreleased - 2021-xx-xx
### Changed
- Minimum supported Rust version (MSRV) is now 1.56.
- Minimum supported Rust version (MSRV) is now 1.56 due to transitive `hashbrown` dependency.


## 3.0.4 - 2022-03-09
Expand Down
2 changes: 1 addition & 1 deletion actix-multipart/CHANGES.md
@@ -1,7 +1,7 @@
# Changes

## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.56.
- Minimum supported Rust version (MSRV) is now 1.56 due to transitive `hashbrown` dependency.


## 0.4.0 - 2022-02-25
Expand Down
2 changes: 1 addition & 1 deletion actix-router/CHANGES.md
@@ -1,7 +1,7 @@
# Changes

## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.56.
- Minimum supported Rust version (MSRV) is now 1.56 due to transitive `hashbrown` dependency.


## 0.5.0 - 2022-02-22
Expand Down
2 changes: 0 additions & 2 deletions actix-router/Cargo.toml
Expand Up @@ -21,15 +21,13 @@ default = ["http"]

[dependencies]
bytestring = ">=0.1.5, <2"
firestorm = "0.5"
http = { version = "0.2.3", optional = true }
regex = "1.5"
serde = "1"
tracing = { version = "0.1.30", default-features = false, features = ["log"] }

[dev-dependencies]
criterion = { version = "0.3", features = ["html_reports"] }
firestorm = { version = "0.5", features = ["enable_system_time"] }
http = "0.2.5"
serde = { version = "1", features = ["derive"] }
percent-encoding = "2.1"
Expand Down
169 changes: 0 additions & 169 deletions actix-router/examples/flamegraph.rs

This file was deleted.

19 changes: 0 additions & 19 deletions actix-router/src/path.rs
@@ -1,7 +1,6 @@
use std::borrow::Cow;
use std::ops::{DerefMut, Index};

use firestorm::profile_method;
use serde::de;

use crate::{de::PathDeserializer, Resource, ResourcePath};
Expand Down Expand Up @@ -52,7 +51,6 @@ impl<T: ResourcePath> Path<T> {
/// Returns full path as a string.
#[inline]
pub fn as_str(&self) -> &str {
profile_method!(as_str);
self.path.path()
}

Expand All @@ -61,7 +59,6 @@ impl<T: ResourcePath> Path<T> {
/// Returns empty string if no more is to be processed.
#[inline]
pub fn unprocessed(&self) -> &str {
profile_method!(unprocessed);
// clamp skip to path length
let skip = (self.skip as usize).min(self.as_str().len());
&self.path.path()[skip..]
Expand All @@ -72,8 +69,6 @@ impl<T: ResourcePath> Path<T> {
#[deprecated(since = "0.6.0", note = "Use `.as_str()` or `.unprocessed()`.")]
#[inline]
pub fn path(&self) -> &str {
profile_method!(path);

let skip = self.skip as usize;
let path = self.path.path();
if skip <= path.len() {
Expand All @@ -86,8 +81,6 @@ impl<T: ResourcePath> Path<T> {
/// Set new path.
#[inline]
pub fn set(&mut self, path: T) {
profile_method!(set);

self.skip = 0;
self.path = path;
self.segments.clear();
Expand All @@ -96,22 +89,17 @@ impl<T: ResourcePath> Path<T> {
/// Reset state.
#[inline]
pub fn reset(&mut self) {
profile_method!(reset);

self.skip = 0;
self.segments.clear();
}

/// Skip first `n` chars in path.
#[inline]
pub fn skip(&mut self, n: u16) {
profile_method!(skip);
self.skip += n;
}

pub(crate) fn add(&mut self, name: impl Into<Cow<'static, str>>, value: PathItem) {
profile_method!(add);

match value {
PathItem::Static(s) => self.segments.push((name.into(), PathItem::Static(s))),
PathItem::Segment(begin, end) => self.segments.push((
Expand All @@ -127,8 +115,6 @@ impl<T: ResourcePath> Path<T> {
name: impl Into<Cow<'static, str>>,
value: impl Into<Cow<'static, str>>,
) {
profile_method!(add_static);

self.segments
.push((name.into(), PathItem::Static(value.into())));
}
Expand All @@ -147,8 +133,6 @@ impl<T: ResourcePath> Path<T> {

/// Get matched parameter by name without type conversion
pub fn get(&self, name: &str) -> Option<&str> {
profile_method!(get);

for (seg_name, val) in self.segments.iter() {
if name == seg_name {
return match val {
Expand All @@ -167,8 +151,6 @@ impl<T: ResourcePath> Path<T> {
///
/// If keyed parameter is not available empty string is used as default value.
pub fn query(&self, key: &str) -> &str {
profile_method!(query);

if let Some(s) = self.get(key) {
s
} else {
Expand All @@ -186,7 +168,6 @@ impl<T: ResourcePath> Path<T> {

/// Try to deserialize matching parameters to a specified type `U`
pub fn load<'de, U: serde::Deserialize<'de>>(&'de self) -> Result<U, de::value::Error> {
profile_method!(load);
de::Deserialize::deserialize(PathDeserializer::new(self))
}
}
Expand Down

0 comments on commit 5377130

Please sign in to comment.