1
0
Fork 0
mirror of https://github.com/lise-henry/crowbook synced 2024-03-29 03:00:02 +01:00

Remove errors due migration to edition 2021.

This commit is contained in:
Florian Bottke 2022-01-15 21:17:30 +01:00
parent b8d35ddc32
commit 44d914a2db
10 changed files with 35 additions and 107 deletions

109
Cargo.lock generated
View File

@ -17,15 +17,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aho-corasick"
version = "0.6.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5"
dependencies = [
"memchr",
]
[[package]]
name = "aho-corasick"
version = "0.7.18"
@ -251,7 +242,7 @@ dependencies = [
"lazy_static 1.4.0",
"pest",
"pest_derive",
"regex 1.5.4",
"regex",
"twoway",
"typed-arena",
"unicode_categories",
@ -266,7 +257,7 @@ dependencies = [
"encode_unicode",
"lazy_static 1.4.0",
"libc",
"regex 1.5.4",
"regex",
"terminal_size",
"termios",
"unicode-width",
@ -283,7 +274,7 @@ dependencies = [
"encode_unicode",
"libc",
"once_cell",
"regex 1.5.4",
"regex",
"terminal_size",
"unicode-width",
"winapi 0.3.9",
@ -360,7 +351,7 @@ dependencies = [
[[package]]
name = "crowbook"
version = "0.15.2"
version = "0.16.0"
dependencies = [
"caribon",
"clap",
@ -390,19 +381,17 @@ dependencies = [
"textwrap 0.12.1",
"url",
"uuid",
"walkdir 2.3.2",
"walkdir",
"yaml-rust",
]
[[package]]
name = "crowbook-intl"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04db38a154dbc8411c49a39b0c514fc29951deaf179bebee581ceb9f72a52c85"
version = "0.2.2"
dependencies = [
"lazy_static 0.2.11",
"regex 0.2.11",
"walkdir 1.0.7",
"lazy_static 1.4.0",
"regex",
"walkdir",
]
[[package]]
@ -421,7 +410,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0fe6b9d03ee72398cab2bd37c564bb898e351c4cff1f5f8a0db2bd9b909accc"
dependencies = [
"lazy_static 1.4.0",
"regex 1.5.4",
"regex",
]
[[package]]
@ -471,7 +460,7 @@ dependencies = [
"html-escape",
"lazy_static 1.4.0",
"mustache",
"regex 1.5.4",
"regex",
"tempdir",
"uuid",
"zip",
@ -820,7 +809,7 @@ dependencies = [
"console 0.15.0",
"lazy_static 1.4.0",
"number_prefix",
"regex 1.5.4",
"regex",
]
[[package]]
@ -1599,37 +1588,15 @@ dependencies = [
"bitflags",
]
[[package]]
name = "regex"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384"
dependencies = [
"aho-corasick 0.6.10",
"memchr",
"regex-syntax 0.5.6",
"thread_local",
"utf8-ranges",
]
[[package]]
name = "regex"
version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
dependencies = [
"aho-corasick 0.7.18",
"aho-corasick",
"memchr",
"regex-syntax 0.6.25",
]
[[package]]
name = "regex-syntax"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7"
dependencies = [
"ucd-util",
"regex-syntax",
]
[[package]]
@ -1712,16 +1679,6 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
[[package]]
name = "same-file"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7"
dependencies = [
"kernel32-sys",
"winapi 0.2.8",
]
[[package]]
name = "same-file"
version = "1.0.6"
@ -1917,11 +1874,11 @@ dependencies = [
"lazycell",
"onig",
"plist",
"regex-syntax 0.6.25",
"regex-syntax",
"serde",
"serde_derive",
"serde_json",
"walkdir 2.3.2",
"walkdir",
"yaml-rust",
]
@ -2015,15 +1972,6 @@ dependencies = [
"syn 1.0.85",
]
[[package]]
name = "thread_local"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
dependencies = [
"lazy_static 1.4.0",
]
[[package]]
name = "time"
version = "0.1.43"
@ -2172,12 +2120,6 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
name = "ucd-util"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c85f514e095d348c279b1e5cd76795082cf15bd59b93207832abe0b1d8fed236"
[[package]]
name = "unchecked-index"
version = "0.2.2"
@ -2244,12 +2186,6 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "utf8-ranges"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba"
[[package]]
name = "utf8-width"
version = "0.1.5"
@ -2283,24 +2219,13 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "walkdir"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff"
dependencies = [
"kernel32-sys",
"same-file 0.1.3",
"winapi 0.2.8",
]
[[package]]
name = "walkdir"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
dependencies = [
"same-file 1.0.6",
"same-file",
"winapi 0.3.9",
"winapi-util",
]

View File

@ -1,7 +1,7 @@
[package]
name = "crowbook"
version = "0.15.2"
edition = "2018"
version = "0.16.0"
edition = "2021"
authors = ["Elisabeth Henry <liz.henry@ouvaton.org>"]
description = "Render a Markdown book in HTML, PDF or Epub"
repository = "https://github.com/lise-henry/crowbook"
@ -42,8 +42,11 @@ proofread = ["caribon", "reqwest", "url", "serde", "serde", "serde_json", "serde
binary = ["clap", "simplelog", "tempdir", "console", "indicatif", "textwrap"]
nightly = ["punkt", "hyphenation"]
[build-dependencies]
crowbook-intl = "0.2"
#[build-dependencies]
#crowbook-intl = "0.2.2"
[build-dependencies.crowbook-intl]
path = "../crowbook-intl"
[dependencies]
mime_guess = "2"

View File

@ -1 +1 @@
Render a markdown book in HTML, Epub or PDF.
Render a markdown book in HTML, EPUB or PDF.

View File

@ -1454,7 +1454,7 @@ impl Book {
}
match String::from_utf8(res) {
Err(_) => panic!(lformat!("header generated by mustache was not valid utf-8")),
Err(_) => panic!("{}", lformat!("header generated by mustache was not valid utf-8")),
Ok(res) => Ok(HeaderData {
text: res,
number: number,

View File

@ -450,7 +450,7 @@ impl BookOptions {
continue;
}
_ => {
panic!(lformat!(
panic!("{}", lformat!(
"Ill-formatted OPTIONS string: unrecognized type \
'{option_type}'",
option_type = option_type.unwrap()

View File

@ -342,13 +342,13 @@ impl<'a> EpubRenderer<'a> {
let mut res: Vec<u8> = vec![];
template.render_data(&mut res, &data)?;
match String::from_utf8(res) {
Err(_) => panic!(lformat!(
Err(_) => panic!("{}", lformat!(
"generated HTML for cover.xhtml was not utf-8 valid"
)),
Ok(res) => Ok(res),
}
} else {
panic!(lformat!("Why is this method called if cover is None???"));
panic!("{}", lformat!("Why is this method called if cover is None???"));
}
}
@ -407,7 +407,7 @@ impl<'a> EpubRenderer<'a> {
let mut res: Vec<u8> = vec![];
template.render_data(&mut res, &data)?;
match String::from_utf8(res) {
Err(_) => panic!(lformat!("generated HTML was not utf-8 valid")),
Err(_) => panic!("{}", lformat!("generated HTML was not utf-8 valid")),
Ok(res) => Ok((
res,
mem::replace(&mut self.chapter_title_raw, String::new()),

View File

@ -19,7 +19,7 @@ pub fn get_hash(lang: &str) -> Hash {
if let Yaml::Hash(hash) = elem {
hash
} else {
panic!(lformat!(
panic!("{}", lformat!(
"Yaml file for language {lang} didn't contain a hash",
lang = lang
));
@ -37,7 +37,7 @@ pub fn get_str(lang: &str, s: &str) -> String {
if let &Yaml::String(ref result) = yaml {
result.clone()
} else {
panic!(lformat!(
panic!("{}", lformat!(
"Yaml for {key} in lang {lang} is not a String!",
key = s,
lang = lang

View File

@ -298,7 +298,7 @@ impl<'a> LatexRenderer<'a> {
let mut res: Vec<u8> = vec![];
template.render_data(&mut res, &data)?;
match String::from_utf8(res) {
Err(_) => panic!(lformat!("generated LaTeX was not valid utf-8")),
Err(_) => panic!("{}", lformat!("generated LaTeX was not valid utf-8")),
Ok(res) => Ok(res),
}
}

View File

@ -158,7 +158,7 @@ impl<'a> OdtRenderer<'a> {
let mut res: Vec<u8> = vec![];
template.render_data(&mut res, &data)?;
match String::from_utf8(res) {
Err(_) => panic!(lformat!("generated content.xml was not utf-8 valid")),
Err(_) => panic!("{}", lformat!("generated content.xml was not utf-8 valid")),
Ok(res) => Ok(res),
}
}

View File

@ -1,7 +1,7 @@
/// Equivalent to assert_eq! but with prettier output
pub fn test_eq(actual: &str, expected: &str) {
if actual != expected {
panic!(format!(
panic!("{}", format!(
"\nexpected:\n{:?}\nactual:\n{:?}\n",
expected, actual
));