Skip to content

Commit 58a25d4

Browse files
Fix nightly clippy warnings
1 parent d80ec11 commit 58a25d4

File tree

16 files changed

+17
-26
lines changed

16 files changed

+17
-26
lines changed

cairo/src/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl Region {
163163

164164
#[doc(alias = "get_extents")]
165165
#[doc(alias = "cairo_region_get_extents")]
166-
pub fn extents(&self, rectangle: &mut RectangleInt) {
166+
pub fn extents(&self, rectangle: &RectangleInt) {
167167
unsafe { ffi::cairo_region_get_extents(self.0.as_ptr(), rectangle.to_raw_none()) }
168168
}
169169

gio/src/file_descriptor_based.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
66
use glib::{prelude::*, translate::*};
77
#[cfg(all(not(unix), docsrs))]
88
use socket::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
9-
use std::fmt;
109

1110
glib::wrapper! {
1211
#[doc(alias = "GFileDescriptorBased")]

gio/src/io_extension_point.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use std::{fmt, marker::PhantomData, ptr};
3+
use std::{marker::PhantomData, ptr};
44

55
use glib::{translate::*, GString, IntoGStr, Type};
66

gio/src/socket_msg_flags.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
use std::fmt;
4-
53
use glib::{bitflags, prelude::*, translate::*, value::FromValue, Type};
64

75
bitflags::bitflags! {

gio/src/unix_mount_entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl Eq for UnixMountEntry {}
194194
impl PartialOrd for UnixMountEntry {
195195
#[inline]
196196
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
197-
self.compare(other).partial_cmp(&0)
197+
Some(self.cmp(other))
198198
}
199199
}
200200

glib/src/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ impl<T: 'static, MM: BoxedMemoryManager<Target = T>> fmt::Debug for Boxed<T, MM>
550550
impl<T, MM: BoxedMemoryManager<Target = T>> PartialOrd for Boxed<T, MM> {
551551
#[inline]
552552
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
553-
self.to_glib_none().0.partial_cmp(&other.to_glib_none().0)
553+
Some(self.cmp(other))
554554
}
555555
}
556556

glib/src/bytes.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,7 @@ impl Eq for Bytes {}
147147
impl PartialOrd for Bytes {
148148
#[inline]
149149
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
150-
unsafe {
151-
let ret = ffi::g_bytes_compare(
152-
ToGlibPtr::<*const _>::to_glib_none(self).0 as *const _,
153-
ToGlibPtr::<*const _>::to_glib_none(other).0 as *const _,
154-
);
155-
ret.partial_cmp(&0)
156-
}
150+
Some(self.cmp(other))
157151
}
158152
}
159153

glib/src/collections/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ pub struct IterMut<'a, T: TransparentPtrType> {
658658

659659
impl<'a, T: TransparentPtrType> IterMut<'a, T> {
660660
#[inline]
661-
fn new(list: &'a mut List<T>) -> IterMut<'a, T> {
661+
fn new(list: &'a List<T>) -> IterMut<'a, T> {
662662
debug_assert_eq!(
663663
mem::size_of::<T>(),
664664
mem::size_of::<<T as GlibPtrDefault>::GlibType>()

glib/src/collections/slist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ pub struct IterMut<'a, T: TransparentPtrType> {
652652

653653
impl<'a, T: TransparentPtrType> IterMut<'a, T> {
654654
#[inline]
655-
fn new(list: &'a mut SList<T>) -> IterMut<'a, T> {
655+
fn new(list: &'a SList<T>) -> IterMut<'a, T> {
656656
debug_assert_eq!(
657657
mem::size_of::<T>(),
658658
mem::size_of::<<T as GlibPtrDefault>::GlibType>()

glib/src/collections/strv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Eq for StrV {}
4646
impl PartialOrd for StrV {
4747
#[inline]
4848
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
49-
self.as_slice().partial_cmp(other.as_slice())
49+
Some(self.cmp(other))
5050
}
5151
}
5252

0 commit comments

Comments
 (0)