clippy: components/canvas/canvas_data.rs (#32843)

Signed-off-by: Rémy Saissy <remy.saissy@gmail.com>
This commit is contained in:
Rémy SAISSY 2024-07-24 17:49:11 +02:00 committed by GitHub
parent 1906741704
commit 7ace7b43dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -251,7 +251,7 @@ impl<'a> UnshapedTextRun<'a> {
} }
} }
fn to_shaped_text_run(self) -> Option<TextRun> { fn into_shaped_text_run(self) -> Option<TextRun> {
let font = self.font?; let font = self.font?;
if self.string.is_empty() { if self.string.is_empty() {
return None; return None;
@ -552,7 +552,7 @@ impl<'a> CanvasData<'a> {
// to be some alignment along a baseline and also support for bidi text. // to be some alignment along a baseline and also support for bidi text.
let shaped_runs: Vec<_> = runs let shaped_runs: Vec<_> = runs
.into_iter() .into_iter()
.filter_map(UnshapedTextRun::to_shaped_text_run) .filter_map(UnshapedTextRun::into_shaped_text_run)
.collect(); .collect();
let total_advance = shaped_runs let total_advance = shaped_runs
.iter() .iter()
@ -635,7 +635,7 @@ impl<'a> CanvasData<'a> {
let shaped_runs: Vec<_> = runs let shaped_runs: Vec<_> = runs
.into_iter() .into_iter()
.filter_map(UnshapedTextRun::to_shaped_text_run) .filter_map(UnshapedTextRun::into_shaped_text_run)
.collect(); .collect();
let total_advance = shaped_runs let total_advance = shaped_runs
.iter() .iter()