@@ -54,7 +54,7 @@ impl Config {
54
54
///
55
55
/// ## Arguments
56
56
///
57
- /// - manifest_path: The path to the location of `Cargo.toml` of the crate being documented
57
+ /// - ` manifest_path` : The path to the location of `Cargo.toml` of the crate being documented
58
58
pub fn new ( manifest_path : PathBuf , assets : Vec < Asset > ) -> Result < Config > {
59
59
let host = analysis:: AnalysisHost :: new ( analysis:: Target :: Debug ) ;
60
60
@@ -71,8 +71,8 @@ impl Config {
71
71
///
72
72
/// ## Arguments
73
73
///
74
- /// - config: The `Config` struct that contains the data needed to generate the documentation
75
- /// - artifacts: A slice containing what assets should be output at the end
74
+ /// - ` config` : The `Config` struct that contains the data needed to generate the documentation
75
+ /// - ` artifacts` : A slice containing what assets should be output at the end
76
76
pub fn build ( config : & Config , artifacts : & [ & str ] ) -> Result < ( ) > {
77
77
generate_and_load_analysis ( config) ?;
78
78
@@ -121,8 +121,8 @@ pub fn build(config: &Config, artifacts: &[&str]) -> Result<()> {
121
121
///
122
122
/// ## Arguments:
123
123
///
124
- /// - config: Contains data for what needs to be output or used. In this case the path to the
125
- /// `Cargo.toml` file
124
+ /// - ` config` : Contains data for what needs to be output or used. In this case the path to the
125
+ /// `Cargo.toml` file
126
126
fn generate_and_load_analysis ( config : & Config ) -> Result < ( ) > {
127
127
let manifest_path = & config. manifest_path ;
128
128
@@ -146,11 +146,11 @@ fn generate_and_load_analysis(config: &Config) -> Result<()> {
146
146
Ok ( ( ) )
147
147
}
148
148
149
- /// This creates the JSON documentation from the given AnalysisHost.
149
+ /// This creates the JSON documentation from the given ` AnalysisHost` .
150
150
pub fn create_json ( host : & AnalysisHost , crate_name : & str ) -> Result < String > {
151
151
let roots = host. def_roots ( ) ?;
152
152
153
- let id = roots. iter ( ) . find ( |& & ( _, ref name) | name == & crate_name) ;
153
+ let id = roots. iter ( ) . find ( |& & ( _, ref name) | name == crate_name) ;
154
154
let root_id = match id {
155
155
Some ( & ( id, _) ) => id,
156
156
_ => return Err ( ErrorKind :: CrateErr ( crate_name. to_string ( ) ) . into ( ) ) ,
@@ -167,7 +167,7 @@ pub fn create_json(host: &AnalysisHost, crate_name: &str) -> Result<String> {
167
167
168
168
let child_defs: Vec < analysis:: Def > = ids. into_par_iter ( )
169
169
. map ( |id : analysis:: Id | recur ( & id, host) )
170
- . reduce ( || Vec :: new ( ) , |mut a : Vec < analysis:: Def > ,
170
+ . reduce ( Vec :: default , |mut a : Vec < analysis:: Def > ,
171
171
b : Vec < analysis:: Def > | {
172
172
a. extend ( b) ;
173
173
a
@@ -208,7 +208,7 @@ pub fn create_json(host: &AnalysisHost, crate_name: &str) -> Result<String> {
208
208
. attributes ( String :: from ( "docs" ) , root_def. docs ) ;
209
209
210
210
// Insert all of the different types of relationships into this `Document` type only
211
- for ( ty, data) in relationships. into_iter ( ) {
211
+ for ( ty, data) in relationships {
212
212
data_document. relationships ( ty, data) ;
213
213
}
214
214
0 commit comments