You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnset_attribute(dom_element:&dom::Element,name:implAsRef<str>,value:implAsRef<str>){clone!(dom_element);let name = name.as_ref().to_string();let value = value.as_ref().to_string();queue_update(move || dom_element.set_attribute(&name,&value).unwrap());}
Basically, you:
request something that can be turned into &str
convert it (potentially a String) into a &str
and then you turn that &str into a String.
That doesn't seem to make sense to me β is there a reason for that?
I believe, ToString would be the right trait to request:
I agree, impl AsRef<str> doesn't look right, and there are probably other places in the code like this. I think Into<String> might be the right trait to require here, but I'll take a look. ToString is implemented in terms of Display and specialized for some std types.
Hi,
Thanks for creating SilkenWeb β so far I really enjoy the nice macro-less API!
(It's smooth as silk... π )
While looking at the source code, I noticed the following function:
Basically, you:
&str
String
) into a&str
&str
into aString
.That doesn't seem to make sense to me β is there a reason for that?
I believe, ToString would be the right trait to request:
The text was updated successfully, but these errors were encountered: