Skip to content

kosciej/fmt_compare_nostd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Utility functions for Display/Debug trait comparison in no_std environment.

This crate provides functions to compare output of Display and Debug traits against &str in no_std env. No alloc nor std is used.

Broader description of the issue that this crate solves: StackOverflow

Quick Start

#![no_std]
use fmt_compare_nostd::eq_display;
use core::fmt::{Display, Formatter, Result};
 
struct D {}

impl Display for D {
   fn fmt(&self, f: &mut Formatter<'_>) -> Result {
       write!(f, "Display D")
   }
}

fn main() {
    assert!(eq_display(&D {}, "Display D"));
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages