aboutsummaryrefslogtreecommitdiff
path: root/stockton-levels/src/traits/light_vols.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:20 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:20 +0100
commit51168c753286eeee64410ab19dc9f78a4ea479e4 (patch)
treed384093c6fd11b36b189013b663f3500b18ec2a4 /stockton-levels/src/traits/light_vols.rs
parentd076d3a6fd484e298915cd85609ba9706abacc87 (diff)
refactor(all): use new traits-based levels everywhere else.
unfortunately this also starts using an unstable feature - generic_associated_types see rust-lang/rust#44265
Diffstat (limited to 'stockton-levels/src/traits/light_vols.rs')
-rw-r--r--stockton-levels/src/traits/light_vols.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/stockton-levels/src/traits/light_vols.rs b/stockton-levels/src/traits/light_vols.rs
index 027709a..8e75401 100644
--- a/stockton-levels/src/traits/light_vols.rs
+++ b/stockton-levels/src/traits/light_vols.rs
@@ -15,8 +15,6 @@
// You should have received a copy of the GNU General Public License
// along with stockton-bsp. If not, see <http://www.gnu.org/licenses/>.
-use std::convert::TryInto;
-
use crate::types::RGB;
#[derive(Debug, Clone, Copy)]
@@ -26,9 +24,9 @@ pub struct LightVol {
pub dir: [u8; 2],
}
-pub trait HasLightVols<'a> {
- type LightVolsIter: Iterator<Item = &'a LightVol>;
+pub trait HasLightVols {
+ type LightVolsIter<'a>: Iterator<Item = &'a LightVol>;
- fn lightvols_iter(&'a self) -> Self::LightVolsIter;
- fn get_lightvol(&'a self, index: u32) -> &'a LightVol;
+ fn lightvols_iter<'a>(&'a self) -> Self::LightVolsIter<'a>;
+ fn get_lightvol<'a>(&'a self, index: u32) -> &'a LightVol;
}