file_model: Make index_of() return a u32

We only ever use it as a u32 elsewhere, so cut out
the casting.
This commit is contained in:
Christopher Davis 2022-06-29 16:58:11 -04:00
parent 70054971d9
commit 8c56e2c66a
2 changed files with 6 additions and 6 deletions

View file

@ -124,9 +124,9 @@ impl LpFileModel {
vec.get(index as usize).cloned()
}
pub fn index_of(&self, file: &gio::File) -> Option<usize> {
pub fn index_of(&self, file: &gio::File) -> Option<u32> {
let imp = self.imp();
let vec = imp.inner.borrow();
vec.iter().position(|f| f.equal(file))
vec.iter().position(|f| f.equal(file)).map(|p| p as u32)
}
}