From 5c764b5f8de56af8c062c60e82bf5b938559f910 Mon Sep 17 00:00:00 2001 From: aprzn Date: Mon, 13 Feb 2023 21:19:19 -0500 Subject: [PATCH] small refactor --- src/music.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/music.rs b/src/music.rs index 3c006be..406a7bb 100644 --- a/src/music.rs +++ b/src/music.rs @@ -55,8 +55,8 @@ impl BeatRate { *self .changes .iter() - .rev() - .find(|&el| el.0 <= &pos) + .filter(|&el| el.0 <= &pos) + .last() .unwrap() .1 } @@ -107,8 +107,8 @@ impl TimeSignature { *self .changes .iter() - .rev() - .find(|&el| el.0 <= &pos) + .filter(|&el| el.0 <= &pos) + .last() .unwrap() .1 }