Skip to content

Commit 08e48aa

Browse files
committed
fix(test-lexarg)!: Clarify struct relationship
I was confused when coming back to the code so the naming being more specific like this didn't help.
1 parent 6dcbec9 commit 08e48aa

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

crates/libtest-lexarg/examples/libtest-cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fn main() -> lexarg::Result<()> {
22
use lexarg::prelude::*;
33

4-
let mut test_opts = libtest_lexarg::TestOptsParseState::new();
4+
let mut test_opts = libtest_lexarg::TestOptsBuilder::new();
55

66
let raw = std::env::args_os().collect::<Vec<_>>();
77
let mut parser = lexarg::Parser::new(&raw);

crates/libtest-lexarg/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! libtest-compatible argument parser
22
//!
3-
//! This does not drive parsing but provides [`TestOptsParseState`] to plug into the parsing,
3+
//! This does not drive parsing but provides [`TestOptsBuilder`] to plug into the parsing,
44
//! allowing additional parsers to be integrated.
55
//!
66
//! ## Example
@@ -18,7 +18,7 @@ use lexarg_error::ErrorContext;
1818

1919
/// Parsed command-line options
2020
///
21-
/// To parse, see [`TestOptsParseState`]
21+
/// To parse, see [`TestOptsBuilder`]
2222
#[derive(Debug, Default)]
2323
pub struct TestOpts {
2424
pub list: bool,
@@ -288,17 +288,17 @@ Test Attributes:
288288

289289
/// Intermediate CLI parser state for [`TestOpts`]
290290
///
291-
/// See [`TestOptsParseState::parse_next`]
291+
/// See [`TestOptsBuilder::parse_next`]
292292
#[derive(Debug, Default)]
293-
pub struct TestOptsParseState {
293+
pub struct TestOptsBuilder {
294294
opts: TestOpts,
295295
quiet: bool,
296296
format: Option<OutputFormat>,
297297
include_ignored: bool,
298298
ignored: bool,
299299
}
300300

301-
impl TestOptsParseState {
301+
impl TestOptsBuilder {
302302
pub fn new() -> Self {
303303
Default::default()
304304
}

crates/libtest2-harness/src/harness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const ERROR_EXIT_CODE: i32 = 101;
7373
fn parse<'p>(
7474
parser: &mut cli::Parser<'p>,
7575
) -> Result<libtest_lexarg::TestOpts, cli::ErrorContext<'p>> {
76-
let mut test_opts = libtest_lexarg::TestOptsParseState::new();
76+
let mut test_opts = libtest_lexarg::TestOptsBuilder::new();
7777

7878
let bin = parser
7979
.next_raw()

0 commit comments

Comments
 (0)