Conversation
|
Currently this works fine: And this not, but it should: |
|
(You might need to target this to the |
|
Came accross the same issue. Merging this would be useful. |
|
I'll review this today hopefully, and add a test case so that we can make sure there isn't a regression in the future. |
|
@mfreeborn, @aleb , the patch is incorrect because it is missing lifetimes. I have a fix for the above. The function signature should be I build locally and the examples work fine with the above. Should I fork and make a different PR or is it better we fix it in this already existing PR ? |
|
Just update the existing PR :)
…________________________________
From: Andrei ***@***.***>
Sent: Tuesday, November 1, 2022 3:14:29 PM
To: igiagkiozis/plotly ***@***.***>
Cc: Michael Freeborn ***@***.***>; Mention ***@***.***>
Subject: Re: [igiagkiozis/plotly] Remove static restriction for str ref (PR #107)
@mfreeborn<https://github.com/mfreeborn>, @aleb<https://github.com/aleb> , the patch is incorrect because it is missing lifetimes. I have a fix for the above. The function signature should be
pub fn to_inline_html<'a, T: Into<Option<&'a str>>>(&self, plot_div_id: T) -> String {
Should I fork and make a different PR or is it better we fix this already existing PR ?
—
Reply to this email directly, view it on GitHub<#107 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHSVKWARJCI2CNPJM57MH2DWGEXVLANCNFSM6AAAAAARJARRIY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hang on a sec, I've just read this properly and I believe what we are looking for is: pub fn to_inline_html<T: Option<AsRef<str>>(&self, plot_div_id: T) -> String {
let plot_div_id = plot_div_id.into();
let plot_div_id = match plot_div_id {
Some(id) => id.as_ref(),
None => Alphanumeric.sample_string(&mut thread_rng(), 20),
};
self.render_inline(plot_div_id)
}EDIT: updated what I think should work as an implementation. |
|
Please create a separate PR, one that is made for the dev branch... I'm not sure how the lifetime addition is better, if you ask me.. many thanks & let me close this |
No description provided.