From a158295782b75bce5f83f5d1c2c476b841493979 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sat, 23 Jul 2022 14:04:43 +0200 Subject: [PATCH] Add docs to PeripheralRef::map_into. --- embassy-hal-common/src/peripheral.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/embassy-hal-common/src/peripheral.rs b/embassy-hal-common/src/peripheral.rs index 62004738..cd0cb8dc 100644 --- a/embassy-hal-common/src/peripheral.rs +++ b/embassy-hal-common/src/peripheral.rs @@ -27,6 +27,12 @@ impl<'a, T> PeripheralRef<'a, T> { } } + /// Map the inner peripheral using `Into`. + /// + /// This converts from `PeripheralRef<'a, T>` to `PeripheralRef<'a, U>`, using an + /// `Into` impl to convert from `T` to `U`. + /// + /// For example, this can be useful to degrade GPIO pins: converting from PeripheralRef<'a, PB11>` to `PeripheralRef<'a, AnyPin>`. #[inline] pub fn map_into(self) -> PeripheralRef<'a, U> where