printable

Crates.ioprintable
lib.rsprintable
version2.2.0
sourcesrc
created_at2023-01-10 16:41:43.352283
updated_at2024-05-21 11:42:45.384798
descriptionProvides `std::fmt::Display` wrapper for iterators and tuples.
homepagehttps://github.com/andrewsonin/printable
repositoryhttps://github.com/andrewsonin/printable
max_upload_size
id755633
size28,084
Andrew Sonin (andrewsonin)

documentation

https://docs.rs/printable/

README

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.
Commit count: 6

cargo fmt