htmx_components/lib.rs
1extern crate self as htmx_components; // Allows components crate to import from itself when expanding macros.
2#[doc(inline)]
3pub use crate::server::html_layout::HtmlLayout;
4pub mod server;
5
6pub fn concat_attribute(field_value: &str, attribute_value: Option<&String>) -> String {
7 let mut values = vec![];
8
9 if !field_value.is_empty() {
10 values.push(field_value.trim());
11 }
12
13 if let Some(value) = attribute_value {
14 values.push(value.trim());
15 }
16
17 values.join(" ")
18}