mirror of
https://github.com/robertwayne/axum-htmx
synced 2024-12-25 01:49:31 +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 {
|
||||
/// Creates new event with no associated data.
|
||||
pub fn new(name: String) -> Self {
|
||||
pub fn new(name: impl AsRef<str>) -> Self {
|
||||
Self {
|
||||
name: name.to_string(),
|
||||
name: name.as_ref().to_owned(),
|
||||
#[cfg(feature = "serde")]
|
||||
data: None,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue