Cleanup yet more compiler warnings
This commit is contained in:
parent
d170372e5a
commit
aff951fa70
2 changed files with 5 additions and 5 deletions
|
@ -14,7 +14,7 @@ fn pdf_result<T>(res: WKResult<T>) -> Result<T, String> {
|
||||||
|
|
||||||
|
|
||||||
fn create_builder<'a>(config: Config, builder: &'a mut PdfBuilder) -> &'a mut PdfBuilder {
|
fn create_builder<'a>(config: Config, builder: &'a mut PdfBuilder) -> &'a mut PdfBuilder {
|
||||||
let mut safe_builder = builder.page_size(PageSize::A4).image_quality(100).title(&config.title);
|
let safe_builder = builder.page_size(PageSize::A4).image_quality(100).title(&config.title);
|
||||||
unsafe {
|
unsafe {
|
||||||
return safe_builder
|
return safe_builder
|
||||||
.global_setting("useCompression", "true")
|
.global_setting("useCompression", "true")
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
use html::{sciter_start, get_html, get_head, find_first};
|
use html::{sciter_start, get_html, get_head};
|
||||||
use sciter::Element;
|
use sciter::Element;
|
||||||
use config::Config;
|
use config::Config;
|
||||||
use assets;
|
use assets;
|
||||||
|
|
||||||
fn create_css_element(style: String) -> Element {
|
fn create_css_element(style: String) -> Element {
|
||||||
let mut style_tag = Element::with_text("style", &style).unwrap();
|
let mut style_tag = Element::with_text("style", &style).unwrap();
|
||||||
style_tag.set_attribute("type", "text/css");
|
style_tag.set_attribute("type", "text/css").expect(&format!("Failed to set CSS mimetype for {}", style));
|
||||||
style_tag.set_attribute("media", "all");
|
style_tag.set_attribute("media", "all").expect(&format!("Failed to set CSS media type for {}", style));
|
||||||
return style_tag;
|
return style_tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,6 @@ fn create_css_element(style: String) -> Element {
|
||||||
pub fn static_files(_: Config, input: String) -> Result<String, String> {
|
pub fn static_files(_: Config, input: String) -> Result<String, String> {
|
||||||
let mut root = sciter_start(input);
|
let mut root = sciter_start(input);
|
||||||
let mut head = get_head(&mut root);
|
let mut head = get_head(&mut root);
|
||||||
head.append(&create_css_element(assets::get("style.css")));
|
head.append(&create_css_element(assets::get("style.css"))).expect("Failed to inject CSS file");
|
||||||
return Ok(get_html(root));
|
return Ok(get_html(root));
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue