What is Nostr?
[yaseenist] Julia :verified_trans: /
npub1hhu…h49a
2023-06-13 01:53:06
in reply to nevent1q…nz7z

[yaseenist] Julia :verified_trans: on Nostr: error[E0308]: mismatched types --> mfm-rs/src/expanded.rs:68:9 | 68 | / ...



error[E0308]: mismatched types
--> mfm-rs/src/expanded.rs:68:9
|
68 | / parser::map(sequence, |children| {
69 | | let children = children
70 | | .into_iter()
71 | | .map(|either| {
... |
77 | | BlockNode::Center { children }
78 | | })
| |__________^ one type is more general than the other
|
= note: expected trait `for<'a, 'b> <[closure@mfm-rs/src/expanded.rs:53:13: 55:84] as FnOnce<(CharIndices<'a>, &'b mut ParserState)>>`
found trait `for<'a, 'b> <[closure@mfm-rs/src/expanded.rs:53:13: 55:84] as FnOnce<(CharIndices<'a>, &'b mut ParserState)>>`
note: this closure does not fulfill the lifetime requirements
--> mfm-rs/src/expanded.rs:53:13
|
53 | / for<'a, 'b> move |chars: CharIndices<'a>,
54 | | state: &'b mut ParserState|
55 | | -> Result<'a, (Vec<Either<InlineNode<'a>, &'a str>>)> {
| |___________________________________________________________________________________^
note: the lifetime requirement is introduced here
--> mfm-rs/src/parser.rs:311:40
|
311 | pub const fn map<F, T, U>(parser: impl for<'a> Parser<Output<'a> = T>, mapper: F) -> impl for<'a> Parser<Output<'a> = U>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think because T isn't generic over 'a, its making it such that the expectation is that T lives forever?
Author Public Key
npub1hhuwd2wgtxcrkgsczvtdpafw3p4xtuf54d2s937hacn9n2vggzdqdph49a