Skip to content

Commit

Permalink
Fix: clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Jul 29, 2024
1 parent fca7c7b commit 1184f34
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions rust/feed/src/transpile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ trait Matcher {
fn matches(&self, s: &Statement) -> bool;
}

#[allow(dead_code)]
#[derive(Clone, Debug)]
struct CallMatcher {}

impl Matcher for CallMatcher {
fn matches(&self, s: &Statement) -> bool {
// Although Exit and Include are handled differently they share the call nature and hence
Expand Down
1 change: 1 addition & 0 deletions rust/nasl-builtin-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ impl NaslHttp {
/// nasl named param
/// - handle The handle identifier
/// - header_item A string to add to the header
///
/// On success the function returns an integer. 0 on success. Null on error.
fn set_custom_header(
&self,
Expand Down
5 changes: 3 additions & 2 deletions rust/nasl-builtin-raw-ip/src/frame_forgery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,9 @@ fn nasl_get_local_mac_address_from_ip(
///This function forges a datalink layer frame.
/// - src_haddr: is a string containing the source MAC address
/// - dst_haddr: is a string containing the destination MAC address
/// -ether_proto: is an int containing the ethernet type (normally given as hexadecimal). It is optional and its default value is 0x0800. A list of Types can be e.g. looked up here.
/// -payload: is any data, which is then attached as payload to the frame.
/// - ether_proto: is an int containing the ethernet type (normally given as hexadecimal).
/// It is optional and its default value is 0x0800. A list of Types can be e.g. looked up here.
/// - payload: is any data, which is then attached as payload to the frame.
fn nasl_forge_frame(register: &Register, _: &Context) -> Result<NaslValue, FunctionErrorKind> {
let src_haddr = validate_mac_address(register.named("src_haddr"))?;
let dst_haddr = validate_mac_address(register.named("dst_haddr"))?;
Expand Down
2 changes: 1 addition & 1 deletion rust/nasl-builtin-raw-ip/src/packet_forgery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ fn format_flags(pkt: &TcpPacket) -> String {
/// - uh_sum: is the UDP checksum. Although it is not compulsory, the right value is computed by default.
/// - uh_ulen: is the data length. By default it is set to the length the data argument plus the size of the UDP header.
/// - update_ip_len: is a flag (TRUE by default). If set, NASL will recompute the size field of the IP datagram.

///
/// Returns the modified IP datagram or NULL on error.
fn forge_udp_packet(
register: &Register,
Expand Down
5 changes: 3 additions & 2 deletions rust/nasl-builtin-ssh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ impl Ssh {
/// - scciphers SSH server-to-client ciphers.
///
/// - timeout Set a timeout for the connection in seconds. Defaults to 10
/// seconds (defined by libssh internally) if not given.
/// seconds (defined by libssh internally) if not given.
///
/// nasl return An integer to identify the ssh session. Zero on error.
fn nasl_ssh_connect(
Expand Down Expand Up @@ -1208,7 +1208,7 @@ impl Ssh {
///
/// nasl named params
/// - timeout: Enable the blocking ssh read until it gives the timeout or there is no
/// bytes left to read.
/// bytes left to read.
///
/// return A string on success or NULL on error.
fn nasl_ssh_shell_read(
Expand Down Expand Up @@ -1942,6 +1942,7 @@ impl Ssh {
///
/// nasluparam
/// - An SSH session id.
///
/// naslret An int on success or NULL on error.
///
/// param[in] lexic Lexical context of NASL interpreter.
Expand Down

0 comments on commit 1184f34

Please sign in to comment.