Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename private function Adc::read to Adc::inner_read
The name conflicts with the public trait method OneShot::read. This isn't an issue with correct programs, as rustc just uses the visible function when called from other crates. But if you forget importing OneShot, you get a confusing error message: ``` error[E0624]: method `read` is private --> rp2040-hal/examples/adc.rs:116:45 | 116 | let temp_sens_adc_counts: u16 = adc.read(&mut temperature_sensor).unwrap(); | ^^^^ private method | ::: /home/jan/rp2040/rp-rs/rp-hal/rp2040-hal/src/adc.rs:302:5 | 302 | fn read(&mut self, chan: u8) -> u16 { | ----------------------------------- private method defined here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | 15 + use cortex_m::prelude::_embedded_hal_adc_OneShot; | ``` Note that the references method in line 302 is not the one that should be called, and also has different parameters. (This was noticed in rp-rs/rp-hal-boards#42)
- Loading branch information