mirror of
https://github.com/lise-henry/crowbook
synced 2024-05-23 09:06:17 +02:00
Fix display of stats when using advanced and feature is not built
Fixes #56
This commit is contained in:
parent
2c8cf45d24
commit
a3ab516339
|
@ -77,7 +77,20 @@ impl Stats {
|
|||
pub fn new(book: &Book, advanced: bool) -> Stats {
|
||||
let lang = book.options.get_str("lang").unwrap();
|
||||
let lang = Stats::language_from_str(lang);
|
||||
let mut stats = Stats { chapters: vec![], advanced: advanced };
|
||||
|
||||
let mut stats;
|
||||
|
||||
if cfg!(not(feature = "nightly")) {
|
||||
if advanced {
|
||||
warn!("{}", lformat!("This version of crowboook has been compiled without support for advanced statistics"));
|
||||
}
|
||||
stats = Stats { chapters: vec![], advanced: false };
|
||||
} else {
|
||||
stats = Stats { chapters: vec![], advanced: advanced };
|
||||
if !advanced {
|
||||
info!("{}", lformat!("For more advanced statistics, use the --verbose or -v option"));
|
||||
}
|
||||
}
|
||||
|
||||
for c in &book.chapters {
|
||||
let name = c.filename.clone();
|
||||
|
|
Loading…
Reference in New Issue