#iterator #display #tuple #formatting

printable

Provides std::fmt::Display wrapper for iterators and tuples

6 releases (stable)

2.2.0 May 21, 2024
2.1.0 May 15, 2024
1.0.1 May 15, 2024
0.1.0 May 15, 2024
0.0.1 Jan 10, 2023

#77 in Value formatting

Download history 728/week @ 2024-07-27 355/week @ 2024-08-03 905/week @ 2024-08-10 724/week @ 2024-08-17 384/week @ 2024-08-24 437/week @ 2024-08-31 82/week @ 2024-09-07 29/week @ 2024-09-14 90/week @ 2024-09-21 50/week @ 2024-09-28 52/week @ 2024-10-05 110/week @ 2024-10-12 32/week @ 2024-10-19 156/week @ 2024-10-26 99/week @ 2024-11-02 61/week @ 2024-11-09

349 downloads per month
Used in 2 crates (via gset)

MIT license

24KB
691 lines

printable

Provides std::fmt::Display wrapper for iterators and tuples.

Crates.io Documentation MIT licensed Build Status

Usage

Displaying iterators.

use printable::prelude::PrintableIter;

let v = vec![1, 2, 3];
assert_eq!(format!("{}", v.iter().printable()), "[1, 2, 3]");

Displaying tuples.

use printable::prelude::PrintableTuple;

let v = (1, "2", 3.0);
assert_eq!(format!("{}", v.printable()), "[1, 2, 3]");

Features

  • unstable-assert-no-drop

    Enables compile-time assertions that the iterators used don't own any resource.

    Warning

    May violate backward compatibility and lead to compilation failure even if the major semver versions of the underlying crates aren't updated.

    This may happen due to the following factors:

    • The std::mem::needs_drop documentation does not guarantee its stability.
    • The fact that the iterator type, which can be declared in a third-party crate, started owning a resource doesn't require increasing the major version of this crate.

No runtime deps

Features