Skip to content

Commit

Permalink
Merge pull request #155 from MiSawa/fix-clippy-needless-borrow
Browse files Browse the repository at this point in the history
Fix against needless borrow warning of clippy
  • Loading branch information
MiSawa committed Sep 5, 2022
2 parents 1d167a5 + 23dc736 commit 3f097b3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::process::Command;
fn main() {
let package_version = env!("CARGO_PKG_VERSION");
let git_revision = Command::new("git")
.args(&["rev-parse", "HEAD"])
.args(["rev-parse", "HEAD"])
.output()
.ok()
.and_then(|o| String::from_utf8(o.stdout).ok())
Expand Down
2 changes: 1 addition & 1 deletion src/compile/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ impl Compiler {
match str {
Some(s) => self.compile_string(
s,
&|compiler: &mut Compiler, next| {
|compiler: &mut Compiler, next| {
Ok(compiler
.emitter
.emit_normal_op(ByteCode::Intrinsic0(stringifier.clone()), next))
Expand Down
2 changes: 1 addition & 1 deletion src/intrinsic/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ pub(crate) fn slice(
path_element,
)),
Value::Array(array) => Ok((
(&array[range]).iter().cloned().collect::<Array>().into(),
array[range].iter().cloned().collect::<Array>().into(),
path_element,
)),
_ => unreachable!(),
Expand Down
2 changes: 1 addition & 1 deletion src/intrinsic/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub(crate) fn text(value: Value) -> Result<Value> {
pub(crate) fn from_json(value: Value) -> Result<Value> {
match value {
Value::String(s) => {
serde_json::from_str(&*s).map_err(|_| QueryExecutionError::InvalidJson(s.clone()))
serde_json::from_str(&s).map_err(|_| QueryExecutionError::InvalidJson(s.clone()))
}
_ => Err(QueryExecutionError::InvalidArgType("fromjson", value)),
}
Expand Down

0 comments on commit 3f097b3

Please sign in to comment.