Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Implement ToOwned correctly #4

Open
NobodyXu opened this issue Feb 20, 2024 · 3 comments
Open

Fix: Implement ToOwned correctly #4

NobodyXu opened this issue Feb 20, 2024 · 3 comments

Comments

@NobodyXu
Copy link
Member

To do that, we would need to update <leon::Tempalte as Clone>::clone to call .to_owned on Cow::Borrowed, which is a breaking change and would need documentation.

@NobodyXu
Copy link
Member Author

Also, leon::Item can only contains & str, so even if we fix the implementation of <leon::Template as Clone>::clone, the leon::Template::items would still contains reference, not String.

To fix that, it has to be changed to Cow<'_, str>.

I didn't remember why we didn't use Cow<'_, str> @passcod .

pub enum Item<'s> {

@passcod
Copy link
Member

passcod commented Feb 21, 2024

Probably just missed it when refactoring

@NobodyXu
Copy link
Member Author

Got it, I would just change it to Cow<'_, str> then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants