Skip to content

Commit 8138fff

Browse files
committed
lints: fix clippy for rust 1.85
1 parent 8808298 commit 8138fff

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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.

boltconn/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "boltconn"
3-
version = "0.10.0"
3+
version = "0.10.1"
44
edition = "2021"
55
readme = "README.md"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

boltconn/src/intercept/script_engine.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,15 @@ impl ScriptEngine {
257257
parts: &mut http::request::Parts,
258258
data: Option<Bytes>,
259259
) -> Option<Bytes> {
260-
if self.pattern.as_ref().map_or(true, |s| s.is_match(url)) {
260+
if self.pattern.as_ref().is_none_or(|s| s.is_match(url)) {
261261
match self.script_type {
262262
ScriptType::Req | ScriptType::All => {
263263
let method = parts.method.to_string();
264264
let header = &parts.headers;
265265
let (_, header, body) =
266266
self.run_js(url, data, method, None, header, "$request")?;
267267
parts.headers = header;
268-
body.map(Bytes::from)
268+
body
269269
}
270270
ScriptType::Resp => None,
271271
}
@@ -281,7 +281,7 @@ impl ScriptEngine {
281281
parts: &mut http::response::Parts,
282282
data: Option<Bytes>,
283283
) -> Option<Bytes> {
284-
if self.pattern.as_ref().map_or(true, |s| s.is_match(url)) {
284+
if self.pattern.as_ref().is_none_or(|s| s.is_match(url)) {
285285
match self.script_type {
286286
ScriptType::Req => None,
287287
ScriptType::Resp | ScriptType::All => {
@@ -298,7 +298,7 @@ impl ScriptEngine {
298298
parts.status = status;
299299
}
300300
parts.headers = header;
301-
body.map(Bytes::from)
301+
body
302302
}
303303
}
304304
} else {

0 commit comments

Comments
 (0)