Skip to content

get rid of test-level imports on tests/*.rs #501

Description

@alejandro-vaz

recently, #495 modularized integration testing, and we have a few files under tests/

some of the tests on those files though, have use statements inside their functions bodies

this use to be necessary because we used to have all the tests for all feature flags in the same file, but that's no longer the case

so simply move all those imports into a top-level item

example:

use smallvec::SmallVec;

#[test]
fn test_serde() {
    use serde_test::{assert_tokens, Token};
    let mut small_vec: SmallVec<i32, 2> = SmallVec::new();
    // ...

should change to

use smallvec::SmallVec;
use serde_test::{assert_tokens, Token};

#[test]
fn test_serde() {
    let mut small_vec: SmallVec<i32, 2> = SmallVec::new();
    // ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueGood for a first contributorhelp wantedNo clear candidate to implement itr-testingrelated to testing

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions