rustdoc_ir 0.1.1

An Intermediate Representation for Rust types and functions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::fmt::{Debug, Formatter};

#[derive(serde::Serialize, serde::Deserialize, Eq, PartialEq, Hash, Clone)]
/// An unassigned generic parameter—e.g. `T` in `fn foo<T>(t: T)`.
pub struct Generic {
    /// The name of the generic parameter, e.g. `"T"`.
    pub name: String,
}

impl Debug for Generic {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.name)
    }
}