Skip to content

Commit

Permalink
Refactor: documentation changes.
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Krämer <[email protected]>
  • Loading branch information
nichtsfrei and Kraemii authored Nov 22, 2023
1 parent 82fcdbf commit 641f294
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
9 changes: 4 additions & 5 deletions rust/feed/src/transpile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{verify, NaslFileFinder};
pub enum FindParameter {
/// Find a parameter by name
Name(String),
/// Find a parameter by name
/// Find a parameter by name and value
NameValue(String, String),
/// Find a parameter by index
Index(usize),
Expand Down Expand Up @@ -59,7 +59,7 @@ pub enum ParameterOperation {
RemoveNamed(String),
/// Removes a parameter found by index
Remove(usize),
/// Removes a parameter found by index
/// Removes all parameter
RemoveAll,
/// Renames a parameter
Rename {
Expand Down Expand Up @@ -107,7 +107,7 @@ impl std::fmt::Display for ParameterOperation {
pub enum Replace {
/// Replaces name of a function
Name(String),
/// Replaces name of a function
/// Remove finding
Remove,
/// Replace parameter
Parameter(ParameterOperation),
Expand Down Expand Up @@ -258,7 +258,6 @@ impl<'a> Matcher for FunctionNameMatcher<'a> {
impl Find {
/// Checks if statement matches the wanted search operation
pub fn matches(&self, s: &Statement) -> bool {
// FunctionNameMatcher { name, parameter }.matches(s)
let (name, parameter) = match self {
Find::FunctionByName(name) => (Some(name as &str), None),
Find::FunctionByParameter(x) => (None, Some(x as &[_])),
Expand All @@ -270,7 +269,7 @@ impl Find {
}

#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
/// Describes what should be replaces
/// Describes what should be replaced
pub struct ReplaceCommand {
/// The identifier to find
pub find: Find,
Expand Down
1 change: 0 additions & 1 deletion rust/feed/src/verify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ impl Hasher {

/// Loads a given hashsums file and lazily verifies the loaded filename key of the sums file and verifies
/// the hash within the sums file with an calculated hash of the found content.
//
pub struct HashSumNameLoader<'a, R> {
reader: &'a dyn AsBufReader<R>,
hasher: Hasher,
Expand Down
3 changes: 1 addition & 2 deletions rust/nasl-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ enum FeedAction {
///
/// The rules describe how to find a certain element and how to replace it.
/// Currently only toml in the following format is supported:
/// ```text
/// ```toml
/// [[cmds]]
///
/// [cmds.find]
Expand Down Expand Up @@ -470,7 +470,6 @@ When piping a scan json it is enriched with the scan-config xml and may the port
verbose: verbose > 0,
},
}
// ah
}
_ => unreachable!("subcommand_required prevents None"),
},
Expand Down

0 comments on commit 641f294

Please sign in to comment.