Skip to content

Commit

Permalink
Fix tests on nightly (removed dead code)
Browse files Browse the repository at this point in the history
  • Loading branch information
la10736 committed Jul 1, 2024
1 parent 1c57831 commit 145faa4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 49 deletions.
5 changes: 1 addition & 4 deletions checkoutlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
- [ ] `Cargo.toml` `rstest`
- [ ] `Cargo.toml` `rstest_macros`
- [ ] `README.md`
- [ ] Run all test
- [ ] Stable: `RSTEST_TEST_CHANNEL=stable cargo +${RSTEST_TEST_CHANNEL} test`
- [ ] Beta: `RSTEST_TEST_CHANNEL=beta cargo +${RSTEST_TEST_CHANNEL} test`
- [ ] Nightly: `RSTEST_TEST_CHANNEL=nightly cargo +${RSTEST_TEST_CHANNEL} test`
- [ ] Run all test: `for channel in stable beta nightly; do RSTEST_TEST_CHANNEL=${channel} cargo +${channel} test; done`
- [ ] Create docs and checks links
- [ ] Check CHANGELOG: **RELEASE DATE** and remove empty blocks
- [ ] Check README
Expand Down
29 changes: 1 addition & 28 deletions rstest_macros/src/parse/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use syn::{

use super::{
arguments::ArgumentsInfo,
extract_argument_attrs, extract_default_return_type, extract_defaults, extract_fixtures,
extract_partials_return_type,
extract_default_return_type, extract_defaults, extract_fixtures, extract_partials_return_type,
future::{extract_futures, extract_global_awt},
parse_vector_trailing_till_double_comma, Attributes, ExtendWithFunctionAttrs, Fixture,
};
Expand Down Expand Up @@ -153,32 +152,6 @@ impl VisitMut for FixturesFunctionExtractor {
}
}

/// Simple struct used to visit function attributes and extract fixture default values info and
/// eventualy parsing errors
#[derive(Default)]
pub(crate) struct DefaultsFunctionExtractor(
pub(crate) Vec<ArgumentValue>,
pub(crate) Vec<syn::Error>,
);

impl VisitMut for DefaultsFunctionExtractor {
fn visit_fn_arg_mut(&mut self, node: &mut FnArg) {
for r in extract_argument_attrs(
node,
|a| attr_is(a, "default"),
|a, name| {
a.parse_args::<Expr>()
.map(|e| ArgumentValue::new(name.clone(), e))
},
) {
match r {
Ok(value) => self.0.push(value),
Err(err) => self.1.push(err),
}
}
}
}

#[derive(PartialEq, Debug, Default)]
pub(crate) struct FixtureData {
pub items: Vec<FixtureItem>,
Expand Down
17 changes: 0 additions & 17 deletions rstest_macros/src/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,23 +340,6 @@ impl VisitMut for PartialsTypeFunctionExtractor {
};
}
}
/// Simple struct used to visit function attributes and extract case arguments and
/// eventualy parsing errors
#[derive(Default)]
struct CaseArgsFunctionExtractor(Vec<Ident>, Vec<syn::Error>);

impl VisitMut for CaseArgsFunctionExtractor {
fn visit_fn_arg_mut(&mut self, node: &mut FnArg) {
for r in extract_argument_attrs(node, |a| attr_is(a, "case"), |_a, name| Ok(name.clone())) {
match r {
Ok(value) => self.0.push(value),
Err(err) => self.1.push(err),
}
}

syn::visit_mut::visit_fn_arg_mut(self, node);
}
}

pub(crate) fn extract_case_args(item_fn: &mut ItemFn) -> Result<Vec<Ident>, ErrorsVec> {
let mut extractor = JustOnceFnArgAttributeExtractor::from("case");
Expand Down

0 comments on commit 145faa4

Please sign in to comment.