What is Nostr?
dave /
npub1tsg…htk4
2023-02-10 08:22:10
in reply to nevent1q…y4gx

dave on Nostr: Alright, let's see if introducing a named lifetime parameter and changing the return ...

Alright, let's see if introducing a named lifetime parameter and changing the return type to String fixes the issue.


fn common_char_functional<'a>(str1: &'a str, str2: &'a str) -> String {
str1.chars()
.filter(|ch1| str2.contains(*ch1))
.collect()
}
Author Public Key
npub1tsgw6pncspg4d5u778hk63s3pls70evs4czfsmx0fzap9xwt203qtkhtk4