Skip to content

Commit 52d736e

Browse files
committed
Update Rust MSRV to 1.45
1 parent 38c8e9d commit 52d736e

File tree

12 files changed

+22
-39
lines changed

12 files changed

+22
-39
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ name: CI
22

33
on:
44
push:
5-
branches: ['master']
5+
branches: ["master"]
66
pull_request:
77

88
jobs:
99
Test:
1010
strategy:
1111
matrix:
1212
os: [ubuntu-latest, macos-latest, windows-latest]
13-
rust: [1.36.0, stable, beta, nightly]
13+
rust: [1.45.0, stable, beta, nightly]
1414
exclude:
1515
- os: macos-latest
16-
rust: 1.36.0
16+
rust: 1.45.0
1717
- os: windows-latest
18-
rust: 1.36.0
18+
rust: 1.45.0
1919
- os: macos-latest
2020
rust: beta
2121
- os: windows-latest
@@ -81,5 +81,5 @@ jobs:
8181
Audit:
8282
runs-on: ubuntu-latest
8383
steps:
84-
- uses: actions/checkout@v1
85-
- uses: EmbarkStudios/cargo-deny-action@v1
84+
- uses: actions/checkout@v1
85+
- uses: EmbarkStudios/cargo-deny-action@v1

LICENSE-MIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013-2016 The rust-url developers
1+
Copyright (c) 2013-2022 The rust-url developers
22

33
Permission is hereby granted, free of charge, to any
44
person obtaining a copy of this software and associated

data-url/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ repository = "https://github.com/servo/rust-url"
77
license = "MIT OR Apache-2.0"
88
edition = "2018"
99
autotests = false
10+
rust-version = "1.45"
1011

1112
[dependencies]
1213
matches = "0.1"

data-url/src/mime.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ fn split2(s: &str, separator: char) -> (&str, Option<&str>) {
6262
(first, iter.next())
6363
}
6464

65-
#[allow(clippy::manual_strip)] // introduced in 1.45, MSRV is 1.36
6665
fn parse_parameters(s: &str, parameters: &mut Vec<(String, String)>) {
6766
let mut semicolon_separated = s.split(';');
6867

@@ -73,10 +72,10 @@ fn parse_parameters(s: &str, parameters: &mut Vec<(String, String)>) {
7372
continue;
7473
}
7574
if let Some(value) = value {
76-
let value = if value.starts_with('"') {
77-
let max_len = value.len().saturating_sub(2); // without start or end quotes
75+
let value = if let Some(stripped) = value.strip_prefix('"') {
76+
let max_len = stripped.len().saturating_sub(1); // without end quote
7877
let mut unescaped_value = String::with_capacity(max_len);
79-
let mut chars = value[1..].chars();
78+
let mut chars = stripped.chars();
8079
'until_closing_quote: loop {
8180
while let Some(c) = chars.next() {
8281
match c {

form_urlencoded/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ description = "Parser and serializer for the application/x-www-form-urlencoded s
66
repository = "https://github.com/servo/rust-url"
77
license = "MIT/Apache-2.0"
88
edition = "2018"
9+
rust-version = "1.45"
910

1011
[lib]
1112
test = false

idna/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ repository = "https://github.com/servo/rust-url/"
77
license = "MIT/Apache-2.0"
88
autotests = false
99
edition = "2018"
10+
rust-version = "1.45"
1011

1112
[lib]
1213
doctest = false

idna/src/uts46.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ fn check_validity(label: &str, config: Config, errors: &mut Errors) {
319319
}
320320

321321
/// http://www.unicode.org/reports/tr46/#Processing
322-
#[allow(clippy::manual_strip)] // introduced in 1.45, MSRV is 1.36
323322
fn processing(
324323
domain: &str,
325324
config: Config,
@@ -384,8 +383,8 @@ fn processing(
384383
output.push('.');
385384
}
386385
first = false;
387-
if label.starts_with(PUNYCODE_PREFIX) {
388-
match decoder.decode(&label[PUNYCODE_PREFIX.len()..]) {
386+
if let Some(remainder) = label.strip_prefix(PUNYCODE_PREFIX) {
387+
match decoder.decode(remainder) {
389388
Ok(decode) => {
390389
let start = output.len();
391390
output.extend(decode);

percent_encoding/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ description = "Percent encoding and decoding"
66
repository = "https://github.com/servo/rust-url/"
77
license = "MIT/Apache-2.0"
88
edition = "2018"
9+
rust-version = "1.45"
910

1011
[features]
1112
default = ["alloc"]

url/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ categories = ["parser-implementations", "web-programming", "encoding"]
1414
license = "MIT/Apache-2.0"
1515
include = ["src/**/*", "LICENSE-*", "README.md", "tests/**"]
1616
edition = "2018"
17+
rust-version = "1.45"
1718

1819
[badges]
1920
travis-ci = { repository = "servo/rust-url" }

url/src/lib.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,14 +1244,9 @@ impl Url {
12441244
/// # }
12451245
/// # run().unwrap();
12461246
/// ```
1247-
#[allow(clippy::manual_strip)] // introduced in 1.45, MSRV is 1.36
12481247
pub fn path_segments(&self) -> Option<str::Split<'_, char>> {
12491248
let path = self.path();
1250-
if path.starts_with('/') {
1251-
Some(path[1..].split('/'))
1252-
} else {
1253-
None
1254-
}
1249+
path.strip_prefix('/').map(|remainder| remainder.split('/'))
12551250
}
12561251

12571252
/// Return this URL’s query string, if any, as a percent-encoded ASCII string.
@@ -1361,8 +1356,7 @@ impl Url {
13611356
}
13621357

13631358
fn mutate<F: FnOnce(&mut Parser<'_>) -> R, R>(&mut self, f: F) -> R {
1364-
#[allow(clippy::mem_replace_with_default)] // introduced in 1.40, MSRV is 1.36
1365-
let mut parser = Parser::for_setter(mem::replace(&mut self.serialization, String::new()));
1359+
let mut parser = Parser::for_setter(mem::take(&mut self.serialization));
13661360
let result = f(&mut parser);
13671361
self.serialization = parser.serialization;
13681362
result

0 commit comments

Comments
 (0)