Skip to content

Commit

Permalink
docs: Fix various markdown issues. (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Oct 10, 2023
1 parent c4f4ad2 commit 3ff7cc2
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc-valid-idents = ["CoreFoundation", ".."]
2 changes: 1 addition & 1 deletion cocoa/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions core-foundation/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<OtherCFType: TCFType>(&self) -> bool {
self.type_of() == OtherCFType::type_id()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -331,7 +331,7 @@ unsafe impl<T: TCFType> 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
Expand Down Expand Up @@ -361,7 +361,7 @@ unsafe impl<T: TCFType> 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<T> {
fn to_void(&self) -> *const c_void;
}
Expand Down
4 changes: 2 additions & 2 deletions core-foundation/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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<T: AsRef<[u8]> + Sync + Send>(buffer: Arc<T>) -> Self {
use crate::base::{CFAllocator, CFAllocatorContext};
use std::os::raw::c_void;
Expand Down
6 changes: 3 additions & 3 deletions core-foundation/src/propertylist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()) }
Expand All @@ -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<OtherCFType: TCFType>(&self) -> bool {
self.type_of() == OtherCFType::type_id()
Expand Down
2 changes: 1 addition & 1 deletion core-foundation/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CFString, ()> {
Ok(CFString::new(string))
Expand Down
4 changes: 2 additions & 2 deletions core-foundation/src/timezone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) }
}
Expand Down
2 changes: 1 addition & 1 deletion core-graphics/src/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions core-graphics/src/data_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions core-graphics/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -208,15 +208,15 @@ 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;

/// Key to access a field that contains scrolling data. The scrolling data
/// 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;

Expand Down

0 comments on commit 3ff7cc2

Please sign in to comment.