Add explicit type definition for ChannelDetails#703
Conversation
This change uses an alias (LdkChannelDetails) and an explicit Vec<LdkChannelDetails> type annotation for 'open_channels' in close_channel_internal and update_channel_config. This resolves type ambiguity caused by a name collision with the local ChannelDetails struct, which prevents rust-analyzer from correctly inferring the type as Vec, leading to an incorrect 'len() is private' error.
|
I've assigned @tnull as a reviewer! |
tnull
left a comment
There was a problem hiding this comment.
Hmm, can't this be fixed on the rust-analyzer side of things? Not a big fan of making changes just for tooling, especially given that every contributor might run slightly different setups.
|
I totally get not wanting to fix things just for tooling. I think Also I think that since Let me know if that makes sense - would be happy to hold-off on this if otherwise. |
Yeah, I don't buy there is any real confusion here. But anyways, if it improves things for you, there is no real harm here. I just know other people don't like to have such additional clutter in the code. But, until they complain, we can go ahead and merge this for now. |
|
Thank you! |
This change uses an alias (
LdkChannelDetails) and an explicitVec<LdkChannelDetails>type annotation foropen_channelsinclose_channel_internalandupdate_channel_config. This resolves type ambiguity caused by a name collision with the localChannelDetailsstruct, which prevents rust-analyzer from correctly inferring the type asVec, leading to an incorrect len() is private error.This is a minor fix that would improve the development experience.