Skip to content

Commit

Permalink
lints: fix clippy for rust 1.85
Browse files Browse the repository at this point in the history
  • Loading branch information
XOR-op committed Feb 21, 2025
1 parent 8808298 commit 8138fff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion boltconn/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "boltconn"
version = "0.10.0"
version = "0.10.1"
edition = "2021"
readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
8 changes: 4 additions & 4 deletions boltconn/src/intercept/script_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ impl ScriptEngine {
parts: &mut http::request::Parts,
data: Option<Bytes>,
) -> Option<Bytes> {
if self.pattern.as_ref().map_or(true, |s| s.is_match(url)) {
if self.pattern.as_ref().is_none_or(|s| s.is_match(url)) {
match self.script_type {
ScriptType::Req | ScriptType::All => {
let method = parts.method.to_string();
let header = &parts.headers;
let (_, header, body) =
self.run_js(url, data, method, None, header, "$request")?;
parts.headers = header;
body.map(Bytes::from)
body
}
ScriptType::Resp => None,
}
Expand All @@ -281,7 +281,7 @@ impl ScriptEngine {
parts: &mut http::response::Parts,
data: Option<Bytes>,
) -> Option<Bytes> {
if self.pattern.as_ref().map_or(true, |s| s.is_match(url)) {
if self.pattern.as_ref().is_none_or(|s| s.is_match(url)) {
match self.script_type {
ScriptType::Req => None,
ScriptType::Resp | ScriptType::All => {
Expand All @@ -298,7 +298,7 @@ impl ScriptEngine {
parts.status = status;
}
parts.headers = header;
body.map(Bytes::from)
body
}
}
} else {
Expand Down

0 comments on commit 8138fff

Please sign in to comment.