Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upScriptOrigin::text duplicates the string contents #27254
Comments
|
I don't know the context, but what about a |
|
I don't think we ever need to mutate the contents of the string, so a straight borrow is probably all that would be required. |
|
So this would just entail updating all the usages so that it works with a reference instead of an owned value then? |
|
Yes, this would require investigating whether it's possible to avoid using an owned value in the code that relies on this method. |
|
Is it okay to introduce a lifetime to |
|
One other option would be storing |
|
Yeah, that's kind of what I was thinking. I think I'll try that later today :) |
|
@jdm I changed
What should I do? |
|
In this case, I think you can add use For example, the servo/components/script/dom/readablestream.rs Lines 49 to 59 in 12d4c0d |
|
Thanks! What reason should I put for the macro? EDIT: Never mind, just saw the reason in your example :) |
Since these scripts can be large minified scripts, if there's a way to borrow the result instead that would be preferable.