Skip to content

Commit 5e0be5c

Browse files
bvincbilelmoussaoui
authored andcommitted
fix glyph string analysis methods that don't need &mut
1 parent 39ef9c0 commit 5e0be5c

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

pango/Gir.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ concurrency = "send+sync"
330330
[[object.function.parameter]]
331331
name = "glyphs"
332332
const = true
333+
[[object.function]]
334+
pattern = "(index_to_x|x_to_index)"
335+
[[object.function.parameter]]
336+
name = "analysis"
337+
const = true
333338

334339
[[object]]
335340
name = "Pango.Language"

pango/src/auto/glyph_string.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,15 @@ impl GlyphString {
6767
}
6868

6969
#[doc(alias = "pango_glyph_string_index_to_x")]
70-
pub fn index_to_x(
71-
&self,
72-
text: &str,
73-
analysis: &mut Analysis,
74-
index_: i32,
75-
trailing: bool,
76-
) -> i32 {
70+
pub fn index_to_x(&self, text: &str, analysis: &Analysis, index_: i32, trailing: bool) -> i32 {
7771
let length = text.len() as _;
7872
unsafe {
7973
let mut x_pos = mem::MaybeUninit::uninit();
8074
ffi::pango_glyph_string_index_to_x(
8175
mut_override(self.to_glib_none().0),
8276
text.to_glib_none().0,
8377
length,
84-
analysis.to_glib_none_mut().0,
78+
mut_override(analysis.to_glib_none().0),
8579
index_,
8680
trailing.into_glib(),
8781
x_pos.as_mut_ptr(),
@@ -105,7 +99,7 @@ impl GlyphString {
10599
}
106100

107101
#[doc(alias = "pango_glyph_string_x_to_index")]
108-
pub fn x_to_index(&self, text: &str, analysis: &mut Analysis, x_pos: i32) -> (i32, i32) {
102+
pub fn x_to_index(&self, text: &str, analysis: &Analysis, x_pos: i32) -> (i32, i32) {
109103
let length = text.len() as _;
110104
unsafe {
111105
let mut index_ = mem::MaybeUninit::uninit();
@@ -114,7 +108,7 @@ impl GlyphString {
114108
mut_override(self.to_glib_none().0),
115109
text.to_glib_none().0,
116110
length,
117-
analysis.to_glib_none_mut().0,
111+
mut_override(analysis.to_glib_none().0),
118112
x_pos,
119113
index_.as_mut_ptr(),
120114
trailing.as_mut_ptr(),

0 commit comments

Comments
 (0)