Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cairo/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl Device {
}

#[doc(alias = "cairo_device_acquire")]
pub fn acquire(&self) -> Result<DeviceAcquireGuard, Error> {
pub fn acquire(&self) -> Result<DeviceAcquireGuard<'_>, Error> {
unsafe {
let status = ffi::cairo_device_acquire(self.to_raw_none());
status_to_result(status)?;
Expand Down
2 changes: 1 addition & 1 deletion cairo/src/image_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl ImageSurface {

#[doc(alias = "cairo_image_surface_get_data")]
#[doc(alias = "get_data")]
pub fn data(&mut self) -> Result<ImageSurfaceData, BorrowError> {
pub fn data(&mut self) -> Result<ImageSurfaceData<'_>, BorrowError> {
unsafe {
if ffi::cairo_surface_get_reference_count(self.to_raw_none()) > 1 {
return Err(BorrowError::NonExclusive);
Expand Down
2 changes: 1 addition & 1 deletion cairo/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Path {
Path(ptr::NonNull::new_unchecked(pointer))
}

pub fn iter(&self) -> PathSegments {
pub fn iter(&self) -> PathSegments<'_> {
use std::slice;

unsafe {
Expand Down
2 changes: 1 addition & 1 deletion gio/src/list_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub trait ListModelExtManual: IsA<ListModel> + Sized {
/// # Panics
///
/// Panics if `T::static_type().is_a(self.item_type())` is not true.
fn iter<LT: IsA<glib::Object>>(&self) -> ListModelIter<LT> {
fn iter<LT: IsA<glib::Object>>(&self) -> ListModelIter<'_, LT> {
assert!(self.item_type().is_a(LT::static_type()));

let len = self.n_items();
Expand Down
2 changes: 1 addition & 1 deletion gio/src/unix_socket_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl UnixSocketAddress {
pub trait UnixSocketAddressExtManual: IsA<UnixSocketAddress> + 'static {
#[doc(alias = "g_unix_socket_address_get_path")]
#[doc(alias = "get_path")]
fn path(&self) -> Option<UnixSocketAddressPath> {
fn path(&self) -> Option<UnixSocketAddressPath<'_>> {
use self::UnixSocketAddressPath::*;

let path = unsafe {
Expand Down
4 changes: 2 additions & 2 deletions glib/src/collections/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ impl<T: TransparentPtrType> List<T> {
// rustdoc-stripper-ignore-next
/// Create a non-destructive iterator over the `List`.
#[inline]
pub fn iter(&self) -> Iter<T> {
pub fn iter(&self) -> Iter<'_, T> {
Iter::new(self)
}

// rustdoc-stripper-ignore-next
/// Create a non-destructive mutable iterator over the `List`.
#[inline]
pub fn iter_mut(&mut self) -> IterMut<T> {
pub fn iter_mut(&mut self) -> IterMut<'_, T> {
IterMut::new(self)
}

Expand Down
4 changes: 2 additions & 2 deletions glib/src/collections/slist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ impl<T: TransparentPtrType> SList<T> {
// rustdoc-stripper-ignore-next
/// Create a non-destructive iterator over the `SList`.
#[inline]
pub fn iter(&self) -> Iter<T> {
pub fn iter(&self) -> Iter<'_, T> {
Iter::new(self)
}

// rustdoc-stripper-ignore-next
/// Create a non-destructive mutable iterator over the `SList`.
#[inline]
pub fn iter_mut(&mut self) -> IterMut<T> {
pub fn iter_mut(&mut self) -> IterMut<'_, T> {
IterMut::new(self)
}

Expand Down
8 changes: 4 additions & 4 deletions glib/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,14 +748,14 @@ impl FlagsClass {
// rustdoc-stripper-ignore-next
/// Returns a new `FlagsBuilder` for conveniently setting/unsetting flags
/// and building a `Value`.
pub fn builder(&self) -> FlagsBuilder {
pub fn builder(&self) -> FlagsBuilder<'_> {
FlagsBuilder::new(self)
}

// rustdoc-stripper-ignore-next
/// Returns a new `FlagsBuilder` for conveniently setting/unsetting flags
/// and building a `Value`. The `Value` is initialized with `value`.
pub fn builder_with_value(&self, value: Value) -> Option<FlagsBuilder> {
pub fn builder_with_value(&self, value: Value) -> Option<FlagsBuilder<'_>> {
if self.type_() != value.type_() {
return None;
}
Expand Down Expand Up @@ -966,12 +966,12 @@ pub type FlagsValues = EnumerationValues<FlagsValue>;
#[must_use = "The builder must be built to be used"]
pub struct FlagsBuilder<'a>(&'a FlagsClass, Option<Value>);
impl FlagsBuilder<'_> {
fn new(flags_class: &FlagsClass) -> FlagsBuilder {
fn new(flags_class: &FlagsClass) -> FlagsBuilder<'_> {
let value = unsafe { Value::from_type_unchecked(flags_class.type_()) };
FlagsBuilder(flags_class, Some(value))
}

fn with_value(flags_class: &FlagsClass, value: Value) -> FlagsBuilder {
fn with_value(flags_class: &FlagsClass, value: Value) -> FlagsBuilder<'_> {
FlagsBuilder(flags_class, Some(value))
}

Expand Down
4 changes: 2 additions & 2 deletions glib/src/main_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl MainContext {
///
/// This will fail if the main context is owned already by another thread.
#[doc(alias = "g_main_context_acquire")]
pub fn acquire(&self) -> Result<MainContextAcquireGuard, crate::BoolError> {
pub fn acquire(&self) -> Result<MainContextAcquireGuard<'_>, crate::BoolError> {
unsafe {
let ret: bool = from_glib(ffi::g_main_context_acquire(self.to_glib_none().0));
if ret {
Expand Down Expand Up @@ -189,7 +189,7 @@ impl Drop for MainContextAcquireGuard<'_> {
struct ThreadDefaultContext<'a>(&'a MainContext);

impl ThreadDefaultContext<'_> {
fn new(ctx: &MainContext) -> ThreadDefaultContext {
fn new(ctx: &MainContext) -> ThreadDefaultContext<'_> {
unsafe {
ffi::g_main_context_push_thread_default(ctx.to_glib_none().0);
}
Expand Down
10 changes: 5 additions & 5 deletions glib/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ pub trait ObjectExt: ObjectType {
///
/// `None` is returned if the object does not implement the interface `T`.
#[doc(alias = "get_interface")]
fn interface<T: IsInterface>(&self) -> Option<InterfaceRef<T>>;
fn interface<T: IsInterface>(&self) -> Option<InterfaceRef<'_, T>>;

// rustdoc-stripper-ignore-next
/// Sets the property `property_name` of the object to value `value`.
Expand Down Expand Up @@ -2307,7 +2307,7 @@ impl<T: ObjectType> ObjectExt for T {
}

#[inline]
fn interface<U: IsInterface>(&self) -> Option<InterfaceRef<U>> {
fn interface<U: IsInterface>(&self) -> Option<InterfaceRef<'_, U>> {
Interface::from_class(self.object_class())
}

Expand Down Expand Up @@ -4037,7 +4037,7 @@ impl<T: IsClass> Class<T> {
/// Gets the parent class struct, if any.
#[doc(alias = "g_type_class_peek_parent")]
#[inline]
pub fn parent(&self) -> Option<ClassRef<T>> {
pub fn parent(&self) -> Option<ClassRef<'_, T>> {
unsafe {
let ptr = gobject_ffi::g_type_class_peek_parent(&self.0 as *const _ as *mut _);
if ptr.is_null() {
Expand Down Expand Up @@ -4176,7 +4176,7 @@ impl<T: IsInterface> Interface<T> {
///
/// This will return `None` if `klass` is not implementing `Self`.
#[inline]
pub fn from_class<U: IsClass>(klass: &Class<U>) -> Option<InterfaceRef<T>> {
pub fn from_class<U: IsClass>(klass: &Class<U>) -> Option<InterfaceRef<'_, T>> {
if !klass.type_().is_a(T::static_type()) {
return None;
}
Expand Down Expand Up @@ -4246,7 +4246,7 @@ impl<T: IsInterface> Interface<T> {
/// interface.
#[doc(alias = "g_type_interface_peek_parent")]
#[inline]
pub fn parent(&self) -> Option<InterfaceRef<T>> {
pub fn parent(&self) -> Option<InterfaceRef<'_, T>> {
unsafe {
let ptr = gobject_ffi::g_type_interface_peek_parent(&self.0 as *const _ as *mut _);
if ptr.is_null() {
Expand Down
14 changes: 7 additions & 7 deletions glib/src/param_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,14 +1129,14 @@ impl ParamSpecEnum {
pub fn builder_with_default<T: StaticType + FromGlib<i32> + IntoGlib<GlibType = i32>>(
name: &str,
default_value: T,
) -> ParamSpecEnumBuilder<T> {
) -> ParamSpecEnumBuilder<'_, T> {
ParamSpecEnumBuilder::new(name, default_value)
}

#[doc(alias = "g_param_spec_enum")]
pub fn builder<T: StaticType + FromGlib<i32> + IntoGlib<GlibType = i32> + Default>(
name: &str,
) -> ParamSpecEnumBuilder<T> {
) -> ParamSpecEnumBuilder<'_, T> {
ParamSpecEnumBuilder::new(name, T::default())
}
}
Expand Down Expand Up @@ -1272,7 +1272,7 @@ impl ParamSpecFlags {
#[doc(alias = "g_param_spec_flags")]
pub fn builder<T: StaticType + FromGlib<u32> + IntoGlib<GlibType = u32>>(
name: &str,
) -> ParamSpecFlagsBuilder<T> {
) -> ParamSpecFlagsBuilder<'_, T> {
ParamSpecFlagsBuilder::new(name)
}
}
Expand Down Expand Up @@ -1442,7 +1442,7 @@ impl ParamSpecString {
}

#[doc(alias = "g_param_spec_string")]
pub fn builder(name: &str) -> ParamSpecStringBuilder {
pub fn builder(name: &str) -> ParamSpecStringBuilder<'_> {
ParamSpecStringBuilder::new(name)
}
}
Expand Down Expand Up @@ -1577,7 +1577,7 @@ impl ParamSpecBoxed {
}

#[doc(alias = "g_param_spec_boxed")]
pub fn builder<T: StaticType>(name: &str) -> ParamSpecBoxedBuilder<T> {
pub fn builder<T: StaticType>(name: &str) -> ParamSpecBoxedBuilder<'_, T> {
ParamSpecBoxedBuilder::new(name)
}
}
Expand Down Expand Up @@ -1736,7 +1736,7 @@ impl ParamSpecValueArray {
}

#[doc(alias = "g_param_spec_value_array")]
pub fn builder(name: &str) -> ParamSpecValueArrayBuilder {
pub fn builder(name: &str) -> ParamSpecValueArrayBuilder<'_> {
ParamSpecValueArrayBuilder::new(name)
}
}
Expand Down Expand Up @@ -1833,7 +1833,7 @@ impl ParamSpecObject {
}

#[doc(alias = "g_param_spec_object")]
pub fn builder<T: StaticType + IsA<Object>>(name: &str) -> ParamSpecObjectBuilder<T> {
pub fn builder<T: StaticType + IsA<Object>>(name: &str) -> ParamSpecObjectBuilder<'_, T> {
ParamSpecObjectBuilder::new(name)
}
}
Expand Down
4 changes: 2 additions & 2 deletions glib/src/subclass/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ pub trait ObjectSubclassExt: ObjectSubclass {
///
/// Shorter alias for `instance()`.
#[doc(alias = "get_instance")]
fn obj(&self) -> crate::BorrowedObject<Self::Type>;
fn obj(&self) -> crate::BorrowedObject<'_, Self::Type>;

// rustdoc-stripper-ignore-next
/// Returns the implementation from an instance.
Expand All @@ -765,7 +765,7 @@ pub trait ObjectSubclassExt: ObjectSubclass {

impl<T: ObjectSubclass> ObjectSubclassExt for T {
#[inline]
fn obj(&self) -> crate::BorrowedObject<Self::Type> {
fn obj(&self) -> crate::BorrowedObject<'_, Self::Type> {
unsafe {
let data = Self::type_data();
let type_ = data.as_ref().type_();
Expand Down
4 changes: 3 additions & 1 deletion glib/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,9 @@ impl Value {
// rustdoc-stripper-ignore-next
/// Tries to get a value of an owned type `T`.
#[inline]
pub fn get_owned<T>(&self) -> Result<T, <<T as FromValue>::Checker as ValueTypeChecker>::Error>
pub fn get_owned<T>(
&self,
) -> Result<T, <<T as FromValue<'_>>::Checker as ValueTypeChecker>::Error>
where
T: for<'b> FromValue<'b> + 'static,
{
Expand Down
2 changes: 1 addition & 1 deletion glib/src/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ impl Variant {
/// }
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
pub fn array_iter_str(&self) -> Result<VariantStrIter, VariantTypeMismatchError> {
pub fn array_iter_str(&self) -> Result<VariantStrIter<'_>, VariantTypeMismatchError> {
let child_ty = String::static_variant_type();
let actual_ty = self.type_();
let expected_ty = child_ty.as_array();
Expand Down
2 changes: 1 addition & 1 deletion glib/src/variant_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ impl VariantTy {
/// # Panics
///
/// This function panics if not called with a tuple or dictionary entry type.
pub fn tuple_types(&self) -> VariantTyIterator {
pub fn tuple_types(&self) -> VariantTyIterator<'_> {
VariantTyIterator::new(self).expect("VariantTy does not represent a tuple")
}

Expand Down
3 changes: 3 additions & 0 deletions pango/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ status = "generate"
name = "from_string"
[object.function.return]
nullable_return_is_error = "Can't parse AttrList"
[[object.function]]
name = "get_iterator"
manual = true

[[object]]
name = "Pango.AttrType"
Expand Down
8 changes: 7 additions & 1 deletion pango/src/attr_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::mem;

use glib::translate::*;

use crate::{ffi, AttrList, Attribute};
use crate::{ffi, AttrIterator, AttrList, Attribute};

impl AttrList {
#[doc(alias = "pango_attr_list_change")]
Expand Down Expand Up @@ -45,6 +45,12 @@ impl AttrList {
mem::forget(attr); //As attr transferred fully
}
}

#[doc(alias = "pango_attr_list_get_iterator")]
#[doc(alias = "get_iterator")]
pub fn iterator(&self) -> AttrIterator<'_> {
unsafe { from_glib_full(ffi::pango_attr_list_get_iterator(self.to_glib_none().0)) }
}
}

#[cfg(feature = "v1_46")]
Expand Down
8 changes: 1 addition & 7 deletions pango/src/auto/attr_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{ffi, AttrIterator, Attribute};
use crate::{ffi, Attribute};
use glib::translate::*;

glib::wrapper! {
Expand Down Expand Up @@ -63,12 +63,6 @@ impl AttrList {
}
}

#[doc(alias = "pango_attr_list_get_iterator")]
#[doc(alias = "get_iterator")]
pub fn iterator(&self) -> AttrIterator {
unsafe { from_glib_full(ffi::pango_attr_list_get_iterator(self.to_glib_none().0)) }
}

#[doc(alias = "pango_attr_list_splice")]
pub fn splice(&self, other: &AttrList, pos: i32, len: i32) {
unsafe {
Expand Down
Loading