diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 000000000..0c939de2c --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +doc-valid-idents = ["CoreFoundation", ".."] diff --git a/cocoa/src/macros.rs b/cocoa/src/macros.rs index 77c6a16d3..264bead5e 100644 --- a/cocoa/src/macros.rs +++ b/cocoa/src/macros.rs @@ -10,7 +10,7 @@ /// Creates a Cocoa delegate to use e.g. with `NSWindow.setDelegate_`. /// Adds instance variables and methods to the definition. /// -/// # Example with NSWindowDelegate +/// # Example with `NSWindowDelegate` /// ``` no_run /// #[macro_use] extern crate cocoa; /// #[macro_use] extern crate objc; diff --git a/core-foundation/src/base.rs b/core-foundation/src/base.rs index 20396ad8c..90105dc59 100644 --- a/core-foundation/src/base.rs +++ b/core-foundation/src/base.rs @@ -158,7 +158,7 @@ pub trait TCFType { /// The reference type wrapped inside this type. type Ref: TCFTypeRef; - /// Returns the object as its concrete TypeRef. + /// Returns the object as its concrete `TypeRef`. fn as_concrete_TypeRef(&self) -> Self::Ref; /// Returns an instance of the object, wrapping the underlying `CFTypeRef` subclass. Use this @@ -211,7 +211,7 @@ pub trait TCFType { unsafe { CFShow(self.as_CFTypeRef()) } } - /// Returns true if this value is an instance of another type. + /// Returns `true` if this value is an instance of another type. #[inline] fn instance_of(&self) -> bool { self.type_of() == OtherCFType::type_id() @@ -303,7 +303,7 @@ impl<'a, T: PartialEq> PartialEq for ItemMutRef<'a, T> { } } -/// A trait describing how to convert from the stored *mut c_void to the desired T +/// A trait describing how to convert from the stored `*mut c_void` to the desired `T` pub unsafe trait FromMutVoid { unsafe fn from_mut_void<'a>(x: *mut c_void) -> ItemMutRef<'a, Self> where @@ -331,7 +331,7 @@ unsafe impl FromMutVoid for T { } } -/// A trait describing how to convert from the stored *const c_void to the desired T +/// A trait describing how to convert from the stored `*const c_void` to the desired `T` pub unsafe trait FromVoid { unsafe fn from_void<'a>(x: *const c_void) -> ItemRef<'a, Self> where @@ -361,7 +361,7 @@ unsafe impl FromVoid for T { } } -/// A trait describing how to convert from the stored *const c_void to the desired T +/// A trait describing how to convert from the stored `*const c_void` to the desired `T` pub unsafe trait ToVoid { fn to_void(&self) -> *const c_void; } diff --git a/core-foundation/src/data.rs b/core-foundation/src/data.rs index fa4106be9..a955061ee 100644 --- a/core-foundation/src/data.rs +++ b/core-foundation/src/data.rs @@ -26,7 +26,7 @@ impl_TCFType!(CFData, CFDataRef, CFDataGetTypeID); impl_CFTypeDescription!(CFData); impl CFData { - /// Creates a CFData around a copy `buffer` + /// Creates a [`CFData`] around a copy `buffer` pub fn from_buffer(buffer: &[u8]) -> CFData { unsafe { let data_ref = CFDataCreate( @@ -38,7 +38,7 @@ impl CFData { } } - /// Creates a CFData referencing `buffer` without creating a copy + /// Creates a [`CFData`] referencing `buffer` without creating a copy pub fn from_arc + Sync + Send>(buffer: Arc) -> Self { use crate::base::{CFAllocator, CFAllocatorContext}; use std::os::raw::c_void; diff --git a/core-foundation/src/propertylist.rs b/core-foundation/src/propertylist.rs index e42bd6106..651989db7 100644 --- a/core-foundation/src/propertylist.rs +++ b/core-foundation/src/propertylist.rs @@ -163,8 +163,8 @@ impl CFPropertyList { unsafe { CFGetRetainCount(self.as_CFTypeRef()) } } - /// Returns the type ID of this object. Will be one of CFData, CFString, CFArray, CFDictionary, - /// CFDate, CFBoolean, or CFNumber. + /// Returns the type ID of this object. Will be one of `CFData`, `CFString`, `CFArray`, + /// `CFDictionary`, `CFDate`, `CFBoolean`, or `CFNumber`. #[inline] pub fn type_of(&self) -> CFTypeID { unsafe { CFGetTypeID(self.as_CFTypeRef()) } @@ -175,7 +175,7 @@ impl CFPropertyList { unsafe { CFShow(self.as_CFTypeRef()) } } - /// Returns true if this value is an instance of another type. + /// Returns `true` if this value is an instance of another type. #[inline] pub fn instance_of(&self) -> bool { self.type_of() == OtherCFType::type_id() diff --git a/core-foundation/src/string.rs b/core-foundation/src/string.rs index 13879e29e..33c1c17bb 100644 --- a/core-foundation/src/string.rs +++ b/core-foundation/src/string.rs @@ -30,7 +30,7 @@ impl_TCFType!(CFString, CFStringRef, CFStringGetTypeID); impl FromStr for CFString { type Err = (); - /// See also CFString::new for a variant of this which does not return a Result + /// See also [`CFString::new()`] for a variant of this which does not return a `Result`. #[inline] fn from_str(string: &str) -> Result { Ok(CFString::new(string)) diff --git a/core-foundation/src/timezone.rs b/core-foundation/src/timezone.rs index c7f3b0225..009be7ebc 100644 --- a/core-foundation/src/timezone.rs +++ b/core-foundation/src/timezone.rs @@ -67,8 +67,8 @@ impl CFTimeZone { CFTimeZone::new(offset.local_minus_utc() as f64) } - /// The timezone database ID that identifies the time zone. E.g. "America/Los_Angeles" or - /// "Europe/Paris". + /// The timezone database ID that identifies the time zone. E.g. `"America/Los_Angeles" `or + /// `"Europe/Paris"`. pub fn name(&self) -> CFString { unsafe { CFString::wrap_under_get_rule(CFTimeZoneGetName(self.0)) } } diff --git a/core-graphics/src/access.rs b/core-graphics/src/access.rs index eee19e3d6..cf51f9eb4 100644 --- a/core-graphics/src/access.rs +++ b/core-graphics/src/access.rs @@ -11,7 +11,7 @@ impl ScreenCaptureAccess { unsafe { CGRequestScreenCaptureAccess() == 1 } } - /// Return true if has access + /// Return `true` if has access #[inline] pub fn preflight(&self) -> bool { unsafe { CGPreflightScreenCaptureAccess() == 1 } diff --git a/core-graphics/src/data_provider.rs b/core-graphics/src/data_provider.rs index 9b3572bc7..e43f9fbc5 100644 --- a/core-graphics/src/data_provider.rs +++ b/core-graphics/src/data_provider.rs @@ -106,10 +106,10 @@ impl CGDataProviderRef { /// Encapsulates custom data that can be wrapped. pub trait CustomData { /// Returns a pointer to the start of the custom data. This pointer *must not change* during - /// the lifespan of this CustomData. + /// the lifespan of this `CustomData`. unsafe fn ptr(&self) -> *const u8; /// Returns the length of this custom data. This value must not change during the lifespan of - /// this CustomData. + /// this `CustomData`. unsafe fn len(&self) -> usize; } diff --git a/core-graphics/src/event.rs b/core-graphics/src/event.rs index 44915c737..3d23f25dc 100644 --- a/core-graphics/src/event.rs +++ b/core-graphics/src/event.rs @@ -177,7 +177,7 @@ impl EventField { pub const MOUSE_EVENT_INSTANT_MOUSER: CGEventField = 6; /// Key to access an integer field that encodes the mouse event subtype as - /// a `kCFNumberIntType'. + /// a `kCFNumberIntType`. pub const MOUSE_EVENT_SUB_TYPE: CGEventField = 7; /// Key to access an integer field, non-zero when this is an autorepeat of @@ -208,7 +208,7 @@ impl EventField { /// since the last scrolling event from a Mighty Mouse scroller or a /// single-wheel mouse scroller. The scrolling data uses a fixed-point /// 16.16 signed integer format. If this key is passed to - /// `CGEventGetDoubleValueField', the fixed-point value is converted to a + /// `CGEventGetDoubleValueField`, the fixed-point value is converted to a /// double value. pub const SCROLL_WHEEL_EVENT_FIXED_POINT_DELTA_AXIS_1: CGEventField = 93; @@ -216,7 +216,7 @@ impl EventField { /// represents a line-based or pixel-based change in horizontal position /// since the last scrolling event from a Mighty Mouse scroller. The /// scrolling data uses a fixed-point 16.16 signed integer format. If this - /// key is passed to `CGEventGetDoubleValueField', the fixed-point value is + /// key is passed to `CGEventGetDoubleValueField`, the fixed-point value is /// converted to a double value. pub const SCROLL_WHEEL_EVENT_FIXED_POINT_DELTA_AXIS_2: CGEventField = 94;