Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Use Into<Option<_>> in argument position where applicable #1590

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
regenerate set manual impl for some functions
  • Loading branch information
fengalin committed Dec 5, 2024
commit 55cb2c15984ba126d52e5a214b372e3ec9d3ffee
49 changes: 1 addition & 48 deletions pango/src/auto/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{
ffi, Analysis, AttrIterator, AttrList, Context, Direction, GlyphString, Item, Stretch, Style,
Variant, Weight,
};
use crate::{ffi, Analysis, AttrList, Direction, GlyphString, Stretch, Style, Variant, Weight};
use glib::translate::*;

//#[cfg_attr(feature = "v1_44", deprecated = "Since 1.44")]
Expand Down Expand Up @@ -57,50 +54,6 @@ pub fn is_zero_width(ch: char) -> bool {
unsafe { from_glib(ffi::pango_is_zero_width(ch.into_glib())) }
}

#[doc(alias = "pango_itemize")]
pub fn itemize<'a>(
context: &Context,
text: &str,
start_index: i32,
length: i32,
attrs: &AttrList,
cached_iter: impl Into<Option<&'a AttrIterator>>,
) -> Vec<Item> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::pango_itemize(
context.to_glib_none().0,
text.to_glib_none().0,
start_index,
length,
attrs.to_glib_none().0,
mut_override(cached_iter.into().to_glib_none().0),
))
}
}

#[doc(alias = "pango_itemize_with_base_dir")]
pub fn itemize_with_base_dir<'a>(
context: &Context,
base_dir: Direction,
text: &str,
start_index: i32,
length: i32,
attrs: &AttrList,
cached_iter: impl Into<Option<&'a AttrIterator>>,
) -> Vec<Item> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::pango_itemize_with_base_dir(
context.to_glib_none().0,
base_dir.into_glib(),
text.to_glib_none().0,
start_index,
length,
attrs.to_glib_none().0,
mut_override(cached_iter.into().to_glib_none().0),
))
}
}

#[doc(alias = "pango_markup_parser_finish")]
pub fn markup_parser_finish(
context: &glib::MarkupParseContext,
Expand Down