From 5e0be5c791f142ef070fbdc16c04800239a07985 Mon Sep 17 00:00:00 2001 From: Brian Vincent Date: Sun, 17 Sep 2023 11:46:48 -0700 Subject: [PATCH] fix glyph string analysis methods that don't need &mut --- pango/Gir.toml | 5 +++++ pango/src/auto/glyph_string.rs | 14 ++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pango/Gir.toml b/pango/Gir.toml index 7471300fbc9c..e6fd48a86715 100644 --- a/pango/Gir.toml +++ b/pango/Gir.toml @@ -330,6 +330,11 @@ concurrency = "send+sync" [[object.function.parameter]] name = "glyphs" const = true + [[object.function]] + pattern = "(index_to_x|x_to_index)" + [[object.function.parameter]] + name = "analysis" + const = true [[object]] name = "Pango.Language" diff --git a/pango/src/auto/glyph_string.rs b/pango/src/auto/glyph_string.rs index a9d4130fb05c..8c8a108c931f 100644 --- a/pango/src/auto/glyph_string.rs +++ b/pango/src/auto/glyph_string.rs @@ -67,13 +67,7 @@ impl GlyphString { } #[doc(alias = "pango_glyph_string_index_to_x")] - pub fn index_to_x( - &self, - text: &str, - analysis: &mut Analysis, - index_: i32, - trailing: bool, - ) -> i32 { + pub fn index_to_x(&self, text: &str, analysis: &Analysis, index_: i32, trailing: bool) -> i32 { let length = text.len() as _; unsafe { let mut x_pos = mem::MaybeUninit::uninit(); @@ -81,7 +75,7 @@ impl GlyphString { mut_override(self.to_glib_none().0), text.to_glib_none().0, length, - analysis.to_glib_none_mut().0, + mut_override(analysis.to_glib_none().0), index_, trailing.into_glib(), x_pos.as_mut_ptr(), @@ -105,7 +99,7 @@ impl GlyphString { } #[doc(alias = "pango_glyph_string_x_to_index")] - pub fn x_to_index(&self, text: &str, analysis: &mut Analysis, x_pos: i32) -> (i32, i32) { + pub fn x_to_index(&self, text: &str, analysis: &Analysis, x_pos: i32) -> (i32, i32) { let length = text.len() as _; unsafe { let mut index_ = mem::MaybeUninit::uninit(); @@ -114,7 +108,7 @@ impl GlyphString { mut_override(self.to_glib_none().0), text.to_glib_none().0, length, - analysis.to_glib_none_mut().0, + mut_override(analysis.to_glib_none().0), x_pos, index_.as_mut_ptr(), trailing.as_mut_ptr(),