An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 589e5921 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

cargo: update to percent-encoding 2.0

parent 36ce2958
...@@ -15,7 +15,7 @@ categories = ["web-programming", "api-bindings"] ...@@ -15,7 +15,7 @@ categories = ["web-programming", "api-bindings"]
[dependencies] [dependencies]
itertools = "~0.8" itertools = "~0.8"
log = "~0.4" log = "~0.4"
percent-encoding = "^1.0" percent-encoding = "^2.0"
reqwest = "~0.9" reqwest = "~0.9"
chrono = { version = "~0.4", features = ["serde"] } chrono = { version = "~0.4", features = ["serde"] }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// except according to those terms. // except according to those terms.
use crates::itertools::Itertools; use crates::itertools::Itertools;
use crates::percent_encoding::{utf8_percent_encode, PercentEncode, PATH_SEGMENT_ENCODE_SET}; use crates::percent_encoding::{utf8_percent_encode, AsciiSet, PercentEncode, CONTROLS};
use crates::reqwest::header::HeaderValue; use crates::reqwest::header::HeaderValue;
use crates::reqwest::{Client, RequestBuilder, Url}; use crates::reqwest::{Client, RequestBuilder, Url};
use crates::serde::de::Error as SerdeError; use crates::serde::de::Error as SerdeError;
...@@ -20,6 +20,19 @@ use types::*; ...@@ -20,6 +20,19 @@ use types::*;
use std::borrow::Borrow; use std::borrow::Borrow;
use std::fmt::{self, Debug, Display}; use std::fmt::{self, Debug, Display};
const PATH_SEGMENT_ENCODE_SET: &AsciiSet = &CONTROLS
.add(b' ')
.add(b'"')
.add(b'#')
.add(b'<')
.add(b'>')
.add(b'`')
.add(b'?')
.add(b'{')
.add(b'}')
.add(b'%')
.add(b'/');
/// A Gitlab API token /// A Gitlab API token
/// ///
/// Gitlab supports two kinds of tokens /// Gitlab supports two kinds of tokens
...@@ -249,7 +262,7 @@ impl Gitlab { ...@@ -249,7 +262,7 @@ impl Gitlab {
} }
/// A URL-safe name for projects. /// A URL-safe name for projects.
fn url_name(name: &str) -> PercentEncode<PATH_SEGMENT_ENCODE_SET> { fn url_name(name: &str) -> PercentEncode {
utf8_percent_encode(name, PATH_SEGMENT_ENCODE_SET) utf8_percent_encode(name, PATH_SEGMENT_ENCODE_SET)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment