Skip to main content

Crate wip

Crate wip 

Source
Expand description

§wip – The crate you’ll never put into production

wip helps you during Rust development by helping signal when something is unfinished.

It plays a role similar to the std::todo macro, but emits warning on use, so that a proper CI blocks uses of this crate from reaching production.

Screenshot of the helix editor displaying various warnings emitted by this crate

§What’s inside?

  • wip extension methods for Result and Option via [WipResultExt::wip] and [WipOptionExt::wip]. They function like unwrap but emit warnings on use, so that you remember to remove them before merging that PR!
  • clone_fixme extension method for any clonable object, for clones that you might later regret, via WipCloneExt::clone_fixme.
  • wip!() macros that emit warnings (wip!) and work with iterators (wip_iter!) and futures (wip_future!, you guessed it)
  • A fixme() macro that doesn’t panic like wip!, but still emit a warning, to keep track of all these // FIXME: handle edge case in your code…

§How to use?

  1. Add the crate to your dependencies.
cargo add wip
  1. (optional) glob import the prelude in your files.
use wip::prelude::*;
  1. Profit!

This crate relies on deprecation warnings, so make sure you don’t #![allow(deprecated)], lest it won’t warn you as intended.

§Alternatives

I don’t currently know of crates exposing the same functionality. However, if you don’t like the idea of adding a dependency for this, did you know you could use doc comments over expressions to benefit from a free warning?

unused doc comment
use `//` for a plain comment
`#[warn(unused_doc_comments)]` on by default

§No genAI

This crate does not use any genAI tooling and intends on staying so.

Modules§

prelude
Prelude to glob import for easy use of the provided functions and extension traits.

Macros§

fixme
Indicates unfinished code, emits a deprecation warning, but does not panic if reached.
wip
Indicates unfinished code, emits a deprecation warning, and panics if reached.
wip_future
Indicates unfinished code, emits a deprecation warning, panics if reached, works for impl Future.
wip_iter
Indicates unfinished code, emits a deprecation warning, panics if reached, works for impl Iterator.

Traits§

WipCloneExt
Extension trait for any clonable T to expose the WipCloneExt::clone_fixme method.
WipOptionExt
Extension trait for std::option::Option to expose the WipOptionExt::unwrap_wip method.
WipResultExt
Extension trait for std::result::Result to expose the WipResultExt::unwrap_wip method.