From 190e00ed621cfe64d89387caf50a3a16cefef6c7 Mon Sep 17 00:00:00 2001 From: Joscha Date: Wed, 16 Apr 2025 22:12:21 +0200 Subject: [PATCH 1/4] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3c9bc5..842db85 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ See the top-level crate documentation for more info. ## But what about that small helper function? -Here it is in full, for posteriority: +Here it is in full, for posterity: ```js function el(name, attributes, ...children) { From f08eda2758fb7e96cd9633793bc54f75642b109f Mon Sep 17 00:00:00 2001 From: Joscha Date: Wed, 16 Apr 2025 22:16:08 +0200 Subject: [PATCH 2/4] Satisfy clippy --- src/check.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/check.rs b/src/check.rs index c4f3387..01f3a59 100644 --- a/src/check.rs +++ b/src/check.rs @@ -58,10 +58,9 @@ pub fn is_valid_raw_text(tag_name: &str, text: &str) -> bool { // "[...] followed by characters that case-insensitively match the tag // name of the element [...]" // - // Note: Since we know that tag names are ascii-only, we can convert - // both to lowercase for a case-insensitive comparison without weird - // unicode shenanigans. - if potential_tag_name.to_ascii_lowercase() != tag_name.to_ascii_lowercase() { + // Note: Since we know that tag names are ascii-only, we can use an + // ASCII-based case insensitive comparison without unicode shenanigans. + if !potential_tag_name.eq_ignore_ascii_case(tag_name) { continue; } From d26ef729eb0684287ab6fc1134629b21a6278e45 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 20 Apr 2026 21:16:41 +0200 Subject: [PATCH 3/4] Update edition, URL, and lints --- Cargo.toml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c2d5f44..b976823 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "el" version = "0.2.0" -edition = "2021" +edition = "2024" authors = ["Garmelon "] description = "Write and manipulate HTML elements as data" -repository = "https://github.com/Garmelon/el" +repository = "https://git.plugh.de/Garmelon/el" license = "MIT OR Apache-2.0" keywords = ["html", "svg", "mathml", "hiccup"] categories = ["web-programming", "template-engine"] @@ -19,10 +19,12 @@ http = { version = "1.0.0", optional = true } [lints] rust.unsafe_code = { level = "forbid", priority = 1 } # Lint groups -rust.deprecated_safe = "warn" -rust.future_incompatible = "warn" -rust.keyword_idents = "warn" -rust.rust_2018_idioms = "warn" +rust.deprecated-safe = "warn" +rust.future-incompatible = "warn" +rust.keyword-idents = "warn" +rust.nonstandard-style = "warn" +rust.refining-impl-trait = "warn" +rust.rust-2018-idioms = "warn" rust.unused = "warn" # Individual lints rust.let_underscore_drop = "warn" From 01d9e06d635c25f39413e8e2c22816689a55f7be Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 20 Apr 2026 22:29:53 +0200 Subject: [PATCH 4/4] Run cargo fmt --- src/axum.rs | 2 +- src/element.rs | 10 +++++++--- src/lib.rs | 10 ++++++---- src/render.rs | 3 +-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/axum.rs b/src/axum.rs index 44059bb..d0b7c64 100644 --- a/src/axum.rs +++ b/src/axum.rs @@ -1,5 +1,5 @@ use axum_core::response::IntoResponse; -use http::{header, HeaderValue, StatusCode}; +use http::{HeaderValue, StatusCode, header}; use crate::{Document, Render}; diff --git a/src/element.rs b/src/element.rs index b8fd828..b2b12e0 100644 --- a/src/element.rs +++ b/src/element.rs @@ -1,4 +1,4 @@ -use std::collections::{btree_map::Entry, BTreeMap, HashMap}; +use std::collections::{BTreeMap, HashMap, btree_map::Entry}; /// The kind of an element. /// @@ -501,8 +501,12 @@ element_component_tuple!(C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11); element_component_tuple!(C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12); element_component_tuple!(C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13); element_component_tuple!(C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14); -element_component_tuple!(C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15); -element_component_tuple!(C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16); +element_component_tuple!( + C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15 +); +element_component_tuple!( + C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16 +); /// A full HTML document including doctype. /// diff --git a/src/lib.rs b/src/lib.rs index 921d6dc..bf907f6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,7 +84,7 @@ pub use self::{element::*, render::*}; #[cfg(test)] mod tests { - use crate::{html::*, Attr, Content, Element, Render}; + use crate::{Attr, Content, Element, Render, html::*}; #[test] fn simple_website() { @@ -130,9 +130,11 @@ mod tests { assert!(script("hello world").render_to_string().is_err()); - assert!(script("hello