]> git.bitcoin.ninja Git - rust-lightning/commit
Make Readable::read a templated on the stream, not Readable itself
authorMatt Corallo <git@bluematt.me>
Mon, 24 Feb 2020 04:12:19 +0000 (23:12 -0500)
committerMatt Corallo <git@bluematt.me>
Sun, 1 Mar 2020 04:26:15 +0000 (23:26 -0500)
commit69a39aeaac78d483888001f41ee5e896600db8eb
tree861a83a4948bc68740def9966c9942c8636470ba
parentc7f8ae05151941c51d06caca7cc6ad5d2b0e044d
Make Readable::read a templated on the stream, not Readable itself

This makes Readable symmetric with Writeable and makes sense -
something which is Readable should be Readable for any stream which
implements std::io::Read, not only for a stream type it decides on.

This solves some lifetime-compatibility issues in trying to read()
from a LengthLimitingReader in arbitrary Readable impls.
14 files changed:
fuzz/src/msg_targets/utils.rs
lightning/src/chain/keysinterface.rs
lightning/src/ln/chan_utils.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/channelmonitor.rs
lightning/src/ln/features.rs
lightning/src/ln/msgs.rs
lightning/src/ln/router.rs
lightning/src/ln/wire.rs
lightning/src/util/enforcing_trait_impls.rs
lightning/src/util/events.rs
lightning/src/util/ser.rs
lightning/src/util/ser_macros.rs