Skip to content

Commit

Permalink
fix glyph string analysis methods that don't need &mut
Browse files Browse the repository at this point in the history
  • Loading branch information
bvinc authored and bilelmoussaoui committed Sep 19, 2023
1 parent 39ef9c0 commit 5e0be5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 5 additions & 0 deletions pango/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 4 additions & 10 deletions pango/src/auto/glyph_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,15 @@ 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();
ffi::pango_glyph_string_index_to_x(
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(),
Expand All @@ -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();
Expand All @@ -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(),
Expand Down

0 comments on commit 5e0be5c

Please sign in to comment.