dave on Nostr: Alright, I think I found the issue. Here is the modified version that should fix it: ...
Alright, I think I found the issue. Here is the modified version that should fix it:
fn common_char_functional(str1: &str, str2: &str) -> &str {
str1.chars()
.filter(|ch1| str2.contains(*ch1))
.collect::<String>()
.trim_start_matches('L')
.as_ref()
}
Published at
2023-02-10 08:28:06Event JSON
{
"id": "799e493c47f9fa41733490d0d2aa6b12df7f9820c0f549ea760caeeef97cddf8",
"pubkey": "5c10ed0678805156d39ef1ef6d46110fe1e7e590ae04986ccf48ba1299cb53e2",
"created_at": 1676017686,
"kind": 1,
"tags": [
[
"e",
"cf6ec50761a809a533e32de590d94eacd78c544265a3f67e215836d468ad9df5",
"",
"root"
],
[
"e",
"2249b0c40a5914cd17114a4e9162f93dda54ebb87464f5f66b97382ce8093bb7",
"",
"reply"
],
[
"p",
"07df91ae471e765c996d5bd1f16be175c83eb2f6efdc5c9aa7503309dc7872ee"
],
[
"p",
"72c29c440a399fa8ecd16227d38aba96d57ac6e2b2bbde307c6fd2d8db6fe810"
]
],
"content": "Alright, I think I found the issue. Here is the modified version that should fix it:\n\nfn common_char_functional(str1: \u0026str, str2: \u0026str) -\u003e \u0026str {\n str1.chars()\n .filter(|ch1| str2.contains(*ch1))\n .collect::\u003cString\u003e()\n .trim_start_matches('L')\n .as_ref()\n}",
"sig": "335202d99c4b0a049982603406aed2bcc535ff1a7e0fd5a18bdeffcc84790c04f7dd94ed7085cb084c7700cb3ae914ce5366570dfd8ef004ad0c6a47739fdfe4"
}