« first day (1997 days earlier)      last day (1485 days later) » 

3:20 AM
is there a way to ask cargo to build a file output for each tests ?
 
 
7 hours later…
10:39 AM
#[cfg(feature = "ascii")]
mod data_ascii;
#[cfg(feature = "ascii")]
use data_ascii::LAY_CHARS;

#[cfg(feature = "bmp")]
mod data_bmp;
#[cfg(feature = "bmp")]
use data_bmp::LAY_CHARS;
How could I do this in a less verbose way ?
I'd like to have a mod data_bmp as data;
 
 
3 hours later…
1:17 PM
@DenysSéguret what is stoping you ?
 
@Stargateur the compiler
 
you mean with the horrible cfg_if::cfg_if! ? Yes of course but I won't include a crate to change a slightly verbose code in a hugely verbose and unreadable one
 
1:32 PM
@DenysSéguret no even without that
it's not clear what you want
 
1:50 PM
#[cfg(feature = "ascii")]
mod data {
    mod data_ascii;
    pub use data_ascii::*;
}
@DenysSéguret ^ (not tested)
Technically it's more verbose, however, you don't need to repeat the #[cfg] part
 
 
1 hour later…
3:16 PM
@trentcl not sure it's better but it's an idea
 
 
3 hours later…
6:23 PM
Cover me, I'm writing a TUI.
 

« first day (1997 days earlier)      last day (1485 days later) »