mirror of
https://github.com/robertwayne/axum-htmx
synced 2025-02-17 09:18:38 +01:00
HxEvent::new takes AsRef<str>; removed redundant .to_string()
This commit is contained in:
parent
29dbadc8bc
commit
4162bd8760
1 changed files with 2 additions and 2 deletions
|
@ -15,9 +15,9 @@ pub struct HxEvent {
|
||||||
|
|
||||||
impl HxEvent {
|
impl HxEvent {
|
||||||
/// Creates new event with no associated data.
|
/// Creates new event with no associated data.
|
||||||
pub fn new(name: String) -> Self {
|
pub fn new(name: impl AsRef<str>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
name: name.to_string(),
|
name: name.as_ref().to_owned(),
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
data: None,
|
data: None,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue