mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-22 08:30:11 +01:00
20fa2fa809
I think this is the final attempt of mine to do anything about the binary size, as those fixes become relatively intricate and I like them less and less. Each commit has its own improvement stats and mainly reduce generic-code duplication through shared non-generic helpers and `#[inline(never)]` boundaries. Total reduction stats: With sccache disabled, `cargo clean` and `cargo build --release -p zed`: Before: zed binary 396716472 bytes After: zed binary 359416504 bytes (-9.40%, -37.29MB) Release Notes: - N/A --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
15 lines
387 B
Rust
15 lines
387 B
Rust
mod html_minifier;
|
|
pub(crate) mod html_parser;
|
|
mod html_rendering;
|
|
|
|
use html5ever::{ParseOpts, parse_document, tendril::TendrilSink};
|
|
use markup5ever_rcdom::RcDom;
|
|
use std::io::{self, Read};
|
|
|
|
#[inline(never)]
|
|
fn parse_html(mut reader: &mut dyn Read) -> io::Result<RcDom> {
|
|
parse_document(RcDom::default(), ParseOpts::default())
|
|
.from_utf8()
|
|
.read_from(&mut reader)
|
|
}
|