Skip to content

Commit

Permalink
cli: remove some dead code
Browse files Browse the repository at this point in the history
It looks like rustc picks this up now but didn't before.
  • Loading branch information
BurntSushi committed Sep 29, 2024
1 parent 92efe4a commit d3d3ff7
Showing 1 changed file with 2 additions and 39 deletions.
41 changes: 2 additions & 39 deletions regex-cli/cmd/find/half/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use std::io::{stdout, Write};

use {
anyhow::Context,
lexopt::{Arg, Parser},
lexopt::Parser,
regex_automata::{HalfMatch, Input, MatchError, PatternID},
};

use crate::{
args::{self, Configurable, Usage},
args,
util::{self, Table},
};

Expand Down Expand Up @@ -49,43 +49,6 @@ ENGINES:
}
}

#[derive(Debug, Default)]
struct Args {
overlapping: bool,
}

impl Configurable for Args {
fn configure(
&mut self,
_: &mut Parser,
arg: &mut Arg,
) -> anyhow::Result<bool> {
match *arg {
Arg::Long("overlapping") => {
self.overlapping = true;
}
_ => return Ok(false),
}
Ok(true)
}

fn usage(&self) -> &[Usage] {
const USAGES: &[Usage] = &[Usage::new(
"--overlapping",
"Search for overlapping matches.",
r#"
This flag enables overlapping mode, where the regex engine will attempt to find
all possible matches reported by the underlying matcher.
Generally this flag is used in conjunction with '--match-kind all'. If the
match semantics are not set to compile all possible matches in the underlying
automaton, then the results will likely be counter-intuitive.
"#,
)];
USAGES
}
}

fn run_regex(p: &mut lexopt::Parser) -> anyhow::Result<()> {
const USAGE: &'static str = "\
Executes a search for half matches using the top-level API regex engine.
Expand Down

0 comments on commit d3d3ff7

Please sign in to comment.