Skip to content

Refactor API / source layout? #17

@epage

Description

@epage

The layout in the docs / source feels strange with everything buried under the predicate module. The goal seems to be to allow imports like:

use predicates::{predicate, Predicate};

Proposal:

  • Move all predicate modules into the root with a pub use in lib.rs
  • Move Predicate and BoxedPredicate in dedicated private files in the root with a pub use in lib.rs.
  • Create a prelude module that contains
    • Predicate
    • predicate module which only re-exports the factory functions
      • Add a note to the factory functions about this
      • Add a note to the *Predicates about using the factories from predicate.

The standard import would now look like:

use predicates::prelude::*;

Benefits

  • Standard import is more consistent with regular stuff
  • Source and docs organization will be less nested
  • Docs will be a little more organized
  • The scope of the predicate module will be narrowed to just factories which imo makes the intent / starting point more clear.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions