[[package]]
name = "clippy"
-version = "0.0.174"
+version = "0.0.175"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cargo_metadata 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "clippy_lints 0.0.174 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy_lints 0.0.175 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "clippy_lints"
-version = "0.0.174"
+version = "0.0.175"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
name = "markdown-rs"
version = "0.1.0"
dependencies = [
- "clippy 0.0.174 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy 0.0.175 (registry+https://github.com/rust-lang/crates.io-index)",
"comrak 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"checksum cairo-sys-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c6e18fecaeac51809db57f45f4553cc0975225a7eb435a7a7e91e5e8113a84d"
"checksum cargo_metadata 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "be1057b8462184f634c3a208ee35b0f935cfd94b694b26deadccd98732088d7b"
"checksum clap 2.28.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc34bf7d5d66268b466b9852bca925ec1d2650654dab4da081e63fd230145c2e"
-"checksum clippy 0.0.174 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03ded6eba74b16dbeb598be58e874bc72f6cf12f7ccc577b328091e1d4392a"
-"checksum clippy_lints 0.0.174 (registry+https://github.com/rust-lang/crates.io-index)" = "9b8e508648d6d41040e0061f45fc5562b3af5c8a7d67853f15841fb531c8e984"
+"checksum clippy 0.0.175 (registry+https://github.com/rust-lang/crates.io-index)" = "2dae056aaec8acd5fc26722234cc9fa03b969a860d9aef0da6c5e5c996ce66ae"
+"checksum clippy_lints 0.0.175 (registry+https://github.com/rust-lang/crates.io-index)" = "d04f24bc10870e19880865d8f206168993bfc6df9cc7335c0692cad98378a4b6"
"checksum comrak 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7bd4bf98681629d26adefa0e7d9d6d6d242ab2495c38e811d726d40a594de324"
"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
"checksum either 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "740178ddf48b1a9e878e6d6509a1442a2d42fd2928aae8e7a6f8a36fb01981b3"
let _ = reader.read_to_string(&mut contents);
text_view.get_buffer().unwrap().set_text(&contents);
- markdown_view.get_buffer().unwrap().set_text(&string_to_html(contents));
+ markdown_view.get_buffer().unwrap().set_text(&string_to_html(&contents));
}
file_chooser.destroy();
text_view.connect_key_release_event(clone!(text_view, markdown_view, live_button => move |_, _| {
if live_button.get_active() {
let buffer = text_view.get_buffer().unwrap();
- markdown_view.get_buffer().unwrap().set_text(&buffer_to_html(buffer));
+ markdown_view.get_buffer().unwrap().set_text(&buffer_to_html(&buffer));
}
Inhibit(true)
}));
render_button.connect_clicked(clone!(text_view, markdown_view => move |_| {
let buffer = text_view.get_buffer().unwrap();
- markdown_view.get_buffer().unwrap().set_text(&buffer_to_html(buffer));
+ markdown_view.get_buffer().unwrap().set_text(&buffer_to_html(&buffer));
}));
about_button.connect_clicked(clone!(about_dialog => move |_| {
use comrak::{markdown_to_html, ComrakOptions};
-pub fn string_to_html(text: String) -> String {
+pub fn string_to_html(text: &str) -> String {
let options = ComrakOptions {
hardbreaks: true,
ext_table: true,
..ComrakOptions::default()
};
- markdown_to_html(&text, &options)
+ markdown_to_html(text, &options)
}
-pub fn buffer_to_html(buffer: TextBuffer) -> String {
+pub fn buffer_to_html(buffer: &TextBuffer) -> String {
let (start, end) = buffer.get_bounds();
let text = buffer.get_text(&start, &end, false);
- string_to_html(text.unwrap())
+ string_to_html(&text.unwrap())
}