(html: &str)
| 500 | const DECLARATION_SIZE_COEFFICIENT: f64 = 30.0; |
| 501 | |
| 502 | fn allocate_output_buffer(html: &str) -> Vec<u8> { |
| 503 | // Allocating more memory than the input HTML, as the inlined version is usually bigger |
| 504 | #[allow( |
| 505 | clippy::cast_precision_loss, |
| 506 | clippy::cast_sign_loss, |
| 507 | clippy::cast_possible_truncation |
| 508 | )] |
| 509 | Vec::with_capacity( |
| 510 | (html.len() as f64 * GROWTH_COEFFICIENT) |
| 511 | .min(usize::MAX as f64) |
| 512 | .round() as usize, |
| 513 | ) |
| 514 | } |
| 515 | |
| 516 | impl<'a> CSSInliner<'a> { |
| 517 | /// Create a new `CSSInliner` instance with given options. |
no outgoing calls
no test coverage detected