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
At present, the Environment::{add_filter, add_function, add_test} methods make it impossible to add filter/function/tests with dynamic (String) names as they expect an &'source str. In my application, filters, functions, and tests are loaded dynamically, so I cannot possibly generate an &str for the names unless I go through some unsafety and keep self-references around. Alternatively, I can simply leak the String, but this is far from ideal.
Ideally, I could simply pass the String to the appropriate method and have that be it. It's not evident to me what's being saved here as a result of using an &str solely, so my proposal is to allow N: Into<Cow<'source, str>> instead, and store the name as a Cow<'source, str>.
The text was updated successfully, but these errors were encountered:
At present, the
Environment::{add_filter, add_function, add_test}
methods make it impossible to add filter/function/tests with dynamic (String
) names as they expect an&'source str
. In my application, filters, functions, and tests are loaded dynamically, so I cannot possibly generate an&str
for the names unless I go through some unsafety and keep self-references around. Alternatively, I can simply leak theString
, but this is far from ideal.Ideally, I could simply pass the
String
to the appropriate method and have that be it. It's not evident to me what's being saved here as a result of using an&str
solely, so my proposal is to allowN: Into<Cow<'source, str>>
instead, and store the name as aCow<'source, str>
.The text was updated successfully, but these errors were encountered: