Skip to content

Commit c176fd3

Browse files
committed
bump version and address new clippy lints
1 parent af6e446 commit c176fd3

8 files changed

Lines changed: 46 additions & 46 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
# 0.18.6
4+
- bump libraries
5+
36
# 0.18.5
47
- changes for maxminddb 0.27.0
58
- bump libraries

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "directory"
3-
version = "0.18.5"
3+
version = "0.18.6"
44
authors = ["El RIDO <elrido@gmx.net>"]
55
edition = "2021"
66
license = "AGPL-3.0"

LICENSE.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This document lists the licenses of the projects used in the instance directory.
1919

2020
#### Used by
2121

22-
- [directory](https://crates.io/crates/directory) 0.18.5
22+
- [directory](https://crates.io/crates/directory) 0.18.6
2323

2424
```
2525
GNU AFFERO GENERAL PUBLIC LICENSE
@@ -3197,15 +3197,15 @@ END OF TERMS AND CONDITIONS
31973197

31983198
#### Used by
31993199

3200-
- [futures-channel](https://github.com/rust-lang/futures-rs) 0.3.31
3201-
- [futures-core](https://github.com/rust-lang/futures-rs) 0.3.31
3202-
- [futures-executor](https://github.com/rust-lang/futures-rs) 0.3.31
3203-
- [futures-io](https://github.com/rust-lang/futures-rs) 0.3.31
3204-
- [futures-macro](https://github.com/rust-lang/futures-rs) 0.3.31
3205-
- [futures-sink](https://github.com/rust-lang/futures-rs) 0.3.31
3206-
- [futures-task](https://github.com/rust-lang/futures-rs) 0.3.31
3207-
- [futures-util](https://github.com/rust-lang/futures-rs) 0.3.31
3208-
- [futures](https://github.com/rust-lang/futures-rs) 0.3.31
3200+
- [futures-channel](https://github.com/rust-lang/futures-rs) 0.3.32
3201+
- [futures-core](https://github.com/rust-lang/futures-rs) 0.3.32
3202+
- [futures-executor](https://github.com/rust-lang/futures-rs) 0.3.32
3203+
- [futures-io](https://github.com/rust-lang/futures-rs) 0.3.32
3204+
- [futures-macro](https://github.com/rust-lang/futures-rs) 0.3.32
3205+
- [futures-sink](https://github.com/rust-lang/futures-rs) 0.3.32
3206+
- [futures-task](https://github.com/rust-lang/futures-rs) 0.3.32
3207+
- [futures-util](https://github.com/rust-lang/futures-rs) 0.3.32
3208+
- [futures](https://github.com/rust-lang/futures-rs) 0.3.32
32093209

32103210
```
32113211
Apache License
@@ -5573,7 +5573,7 @@ limitations under the License.
55735573
- [pkg-config](https://github.com/rust-lang/pkg-config-rs) 0.3.32
55745574
- [regex-automata](https://github.com/rust-lang/regex) 0.4.12
55755575
- [regex-syntax](https://github.com/rust-lang/regex/tree/master/regex-syntax) 0.8.5
5576-
- [regex](https://github.com/rust-lang/regex) 1.12.2
5576+
- [regex](https://github.com/rust-lang/regex) 1.12.3
55775577
- [ring](https://github.com/briansmith/ring) 0.17.14
55785578
- [rustix](https://github.com/bytecodealliance/rustix) 1.0.7
55795579
- [rustls](https://github.com/rustls/rustls) 0.23.30
@@ -5590,7 +5590,7 @@ limitations under the License.
55905590
- [thread_local](https://github.com/Amanieu/thread_local-rs) 1.1.9
55915591
- [ucd-trie](https://github.com/BurntSushi/ucd-generate) 0.1.7
55925592
- [unicode-xid](https://github.com/unicode-rs/unicode-xid) 0.2.6
5593-
- [url](https://github.com/servo/rust-url) 2.5.7
5593+
- [url](https://github.com/servo/rust-url) 2.5.8
55945594
- [version_check](https://github.com/SergioBenitez/version_check) 0.9.5
55955595
- [wasi](https://github.com/bytecodealliance/wasi) 0.11.1+wasi-snapshot-preview1
55965596
- [wasi](https://github.com/bytecodealliance/wasi-rs) 0.14.2+wasi-0.2.4
@@ -8212,7 +8212,7 @@ third-party/chromium/LICENSE.
82128212

82138213
#### Used by
82148214

8215-
- [maxminddb](https://github.com/oschwald/maxminddb-rust) 0.27.0
8215+
- [maxminddb](https://github.com/oschwald/maxminddb-rust) 0.27.3
82168216

82178217
```
82188218
ISC License
@@ -8471,7 +8471,7 @@ DEALINGS IN THE SOFTWARE.
84718471

84728472
#### Used by
84738473

8474-
- [bytes](https://github.com/tokio-rs/bytes) 1.10.1
8474+
- [bytes](https://github.com/tokio-rs/bytes) 1.11.1
84758475

84768476
```
84778477
Copyright (c) 2018 Carl Lerche
@@ -8829,7 +8829,7 @@ DEALINGS IN THE SOFTWARE.
88298829

88308830
#### Used by
88318831

8832-
- [hyper-util](https://github.com/hyperium/hyper-util) 0.1.18
8832+
- [hyper-util](https://github.com/hyperium/hyper-util) 0.1.20
88338833

88348834
```
88358835
Copyright (c) 2023-2025 Sean McArthur
@@ -9049,7 +9049,7 @@ THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRES
90499049

90509050
- [tokio-stream](https://github.com/tokio-rs/tokio) 0.1.17
90519051
- [tokio-util](https://github.com/tokio-rs/tokio) 0.7.15
9052-
- [tokio](https://github.com/tokio-rs/tokio) 1.48.0
9052+
- [tokio](https://github.com/tokio-rs/tokio) 1.50.0
90539053

90549054
```
90559055
MIT License

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ fn favicon() -> Redirect {
450450
Redirect::permanent("/img/favicon.ico")
451451
}
452452

453+
#[allow(clippy::result_large_err)]
453454
#[rocket::main]
454455
async fn main() -> Result<(), Error> {
455456
let rocket = rocket();

src/models.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ impl PrivateBin {
413413
reader: body.aggregate().reader(),
414414
line_count: 0,
415415
};
416+
let template_expression =
417+
TEMPLATE_EXP.get_or_init(|| Regex::new(r"css/bootstrap(\d*)/").unwrap());
418+
let version_expression = VERSION_EXP.get_or_init(|| {
419+
Regex::new(r"js/(privatebin|zerobin).js\?(Alpha%20)?(\d+\.\d+\.*\d*)").unwrap()
420+
});
416421
for line in reader {
417422
let line_str = match line {
418423
Ok(string) => string,
@@ -427,10 +432,7 @@ impl PrivateBin {
427432
}
428433
}
429434
if template == PrivateBinTemplate::Unknown {
430-
if let Some(matches) = TEMPLATE_EXP
431-
.get_or_init(|| Regex::new(r"css/bootstrap(\d*)/").unwrap())
432-
.captures(&line_str)
433-
{
435+
if let Some(matches) = template_expression.captures(&line_str) {
434436
template = if matches[1].is_empty() {
435437
PrivateBinTemplate::Bootstrap3
436438
} else {
@@ -439,13 +441,7 @@ impl PrivateBin {
439441
}
440442
}
441443
if version.is_empty() {
442-
if let Some(matches) = VERSION_EXP
443-
.get_or_init(|| {
444-
Regex::new(r"js/(privatebin|zerobin).js\?(Alpha%20)?(\d+\.\d+\.*\d*)")
445-
.unwrap()
446-
})
447-
.captures(&line_str)
448-
{
444+
if let Some(matches) = version_expression.captures(&line_str) {
449445
matches[3].clone_into(&mut version);
450446
}
451447
}

src/tasks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub async fn check_full(rocket: Rocket<Build>) {
162162
}
163163

164164
#[allow(clippy::too_many_lines)]
165-
async fn check_instance(instance: &Instance) -> InstanceCheckResult {
165+
async fn check_instance(instance: &Instance) -> InstanceCheckResult<'_> {
166166
let timer = Instant::now();
167167
let mut message = String::new();
168168
let mut instance_options = [

src/tests.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ fn index() {
1212
assert_eq!(response.status(), Status::Ok);
1313
assert!(response
1414
.into_string()
15-
.map_or(false, |s| s.contains("Welcome!")));
15+
.is_some_and(|s| s.contains("Welcome!")));
1616
}
1717

1818
#[test]
1919
fn about() {
2020
let client = Client::untracked(rocket()).expect("valid rocket instance");
2121
let response = client.get("/about").dispatch();
2222
assert_eq!(response.status(), Status::Ok);
23-
assert!(response
24-
.into_string()
25-
.map_or(false, |s| s.contains("About")));
23+
assert!(response.into_string().is_some_and(|s| s.contains("About")));
2624
}
2725

2826
#[test]
@@ -32,7 +30,7 @@ fn add_get() {
3230
assert_eq!(response.status(), Status::Ok);
3331
assert!(response
3432
.into_string()
35-
.map_or(false, |s| s.contains("Add instance")));
33+
.is_some_and(|s| s.contains("Add instance")));
3634
}
3735

3836
#[test]
@@ -46,15 +44,15 @@ fn add_post_error() {
4644
assert_eq!(response.status(), Status::Ok);
4745
assert!(response
4846
.into_string()
49-
.map_or(false, |s| s.contains("Not a valid URL: privatebin.info")));
47+
.is_some_and(|s| s.contains("Not a valid URL: privatebin.info")));
5048

5149
let response = client
5250
.post("/add")
5351
.body("url=privatebin.info")
5452
.header(ContentType::Form)
5553
.dispatch();
5654
assert_eq!(response.status(), Status::Ok);
57-
assert!(response.into_string().map_or(false, |s| s.contains(
55+
assert!(response.into_string().is_some_and(|s| s.contains(
5856
"Error adding URL privatebin.info, due to a failed scan within the last 5 minutes."
5957
)));
6058

@@ -67,7 +65,7 @@ fn add_post_error() {
6765
assert_eq!(response.status(), Status::Ok);
6866
assert!(response
6967
.into_string()
70-
.map_or(false, |s| s.contains("Not a valid URL: privatebin.info")));
68+
.is_some_and(|s| s.contains("Not a valid URL: privatebin.info")));
7169
}
7270

7371
#[test]
@@ -79,8 +77,9 @@ fn add_post_success() {
7977
.header(ContentType::Form)
8078
.dispatch();
8179
assert_eq!(response.status(), Status::Ok);
82-
assert!(response.into_string().map_or(false, |s| s
83-
.contains("Successfully added URL: https:&#x2F;&#x2F;privatebin.net")));
80+
assert!(response
81+
.into_string()
82+
.is_some_and(|s| s.contains("Successfully added URL: https:&#x2F;&#x2F;privatebin.net")));
8483
}
8584

8685
#[test]
@@ -90,7 +89,7 @@ fn check_get() {
9089
assert_eq!(response.status(), Status::Ok);
9190
assert!(response
9291
.into_string()
93-
.map_or(false, |s| s.contains("Check instance")));
92+
.is_some_and(|s| s.contains("Check instance")));
9493
}
9594

9695
#[test]
@@ -104,15 +103,15 @@ fn check_post_error() {
104103
assert_eq!(response.status(), Status::Ok);
105104
assert!(response
106105
.into_string()
107-
.map_or(false, |s| s.contains("Not a valid URL: privatebin.info")));
106+
.is_some_and(|s| s.contains("Not a valid URL: privatebin.info")));
108107

109108
let response = client
110109
.post("/check")
111110
.body("url=privatebin.info")
112111
.header(ContentType::Form)
113112
.dispatch();
114113
assert_eq!(response.status(), Status::Ok);
115-
assert!(response.into_string().map_or(false, |s| s.contains(
114+
assert!(response.into_string().is_some_and(|s| s.contains(
116115
"Error scanning URL privatebin.info, due to a failed scan within the last 5 minutes."
117116
)));
118117

@@ -125,7 +124,7 @@ fn check_post_error() {
125124
assert_eq!(response.status(), Status::Ok);
126125
assert!(response
127126
.into_string()
128-
.map_or(false, |s| s.contains("Not a valid URL: privatebin.info")));
127+
.is_some_and(|s| s.contains("Not a valid URL: privatebin.info")));
129128
}
130129

131130
#[test]
@@ -137,8 +136,9 @@ fn check_post_success() {
137136
.header(ContentType::Form)
138137
.dispatch();
139138
assert_eq!(response.status(), Status::Ok);
140-
assert!(response.into_string().map_or(false, |s| s
141-
.contains("Results of checking https:&#x2F;&#x2F;privatebin.net")));
139+
assert!(response
140+
.into_string()
141+
.is_some_and(|s| s.contains("Results of checking https:&#x2F;&#x2F;privatebin.net")));
142142
}
143143

144144
#[test]

0 commit comments

Comments
 (0)