Skip to content

Commit

Permalink
normalise language, break lines, wrap Rust paths in backticks
Browse files Browse the repository at this point in the history
  • Loading branch information
its-the-shrimp committed Jul 20, 2024
1 parent c08d7ae commit dfcdcca
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/rustdoc-json-types/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ pub struct Constant {
pub is_literal: bool,
}

/// Describes a constraint applied to an associated type/constant, e.g.
/// Describes a bound applied to an associated type/constant.
///
/// Example:
/// ```text
/// IntoIterator<Item = u32, IntoIter: Clone>
/// ^^^^^^^^^^ ^^^^^^^^^^^^^^^
Expand All @@ -253,7 +255,7 @@ pub struct TypeBinding {
pub name: String,
/// Arguments provided to the associated type/constant.
pub args: GenericArgs,
/// The constraint applied to the associated type/constant.
/// The kind of bound applied to the associated type/constant.
pub binding: TypeBindingKind,
}

Expand All @@ -278,8 +280,8 @@ pub enum TypeBindingKind {

/// An opaque identifier for an item.
///
/// It can be used to lookup in [Crate::index] or [Crate::paths] to resolve it
/// to an [Item].
/// It can be used to lookup in [`Crate::index`] or [`Crate::paths`] to resolve it
/// to an [`Item`].
///
/// Id's are only valid within a single JSON blob. They cannot be used to
/// resolve references between the JSON output's for different crates.
Expand All @@ -292,6 +294,8 @@ pub enum TypeBindingKind {
pub struct Id(pub String);

/// The fundamental kind of an item. Unlike [`ItemEnum`], this does not carry any aditional info.
///
/// See [`ItemSummary`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ItemKind {
Expand Down Expand Up @@ -352,6 +356,7 @@ pub enum ItemKind {
}

/// Specific fields of an item.
///
/// See [`Item`].
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
Expand Down Expand Up @@ -626,7 +631,7 @@ pub struct Header {
/// Is this function async?
#[serde(rename = "async")]
pub async_: bool,
/// The calling convention used by the function.
/// The ABI used by the function.
pub abi: Abi,
}

Expand Down Expand Up @@ -820,7 +825,7 @@ pub enum WherePredicate {
},
}

/// Either a trait bound or a lifetime constraint.
/// Either a trait bound or a lifetime bound.
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum GenericBound {
Expand Down Expand Up @@ -1014,8 +1019,7 @@ pub struct FunctionPointer {
/// // ^^^^^^^
/// ```
pub generic_params: Vec<GenericParamDef>,
/// The core properties of the function, such as its calling convention, whether it is unsafe,
/// etc.
/// The core properties of the function, such as the ABI it conforms to, whether it's unsafe, etc.
pub header: Header,
}

Expand Down

0 comments on commit dfcdcca

Please sign in to comment.