From 4c50c083fbdc71db38d5cee8ce64e4e9e0c740cc Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:12:09 +0000 Subject: [PATCH] Rust: Implement good suggestions from ql-for-ql. --- rust/ql/lib/codeql/rust/frameworks/Reqwest.qll | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/Reqwest.qll b/rust/ql/lib/codeql/rust/frameworks/Reqwest.qll index 141f9767ecad..2ab11a20ed4b 100644 --- a/rust/ql/lib/codeql/rust/frameworks/Reqwest.qll +++ b/rust/ql/lib/codeql/rust/frameworks/Reqwest.qll @@ -9,11 +9,11 @@ private import codeql.rust.Concepts * A call to `reqwest::get` or `reqwest::blocking::get`. */ private class ReqwestGet extends RemoteSource::Range { - CallExpr ce; - ReqwestGet() { - this.asExpr().getExpr() = ce and - ce.getExpr().(PathExpr).getPath().getResolvedCrateOrigin().matches("%reqwest") and - ce.getExpr().(PathExpr).getPath().getResolvedPath() = ["crate::get", "crate::blocking::get"] + exists(CallExpr ce | + this.asExpr().getExpr() = ce and + ce.getExpr().(PathExpr).getPath().getResolvedCrateOrigin().matches("%reqwest") and + ce.getExpr().(PathExpr).getPath().getResolvedPath() = ["crate::get", "crate::blocking::get"] + ) } }