@@ -54,17 +54,17 @@ impl FromStr for Config {
54
54
}
55
55
}
56
56
57
- impl Into < mdbook :: Config > for Config {
58
- fn into ( self ) -> mdbook :: Config {
57
+ impl From < Config > for mdbook :: Config {
58
+ fn from ( conf : Config ) -> Self {
59
59
let mut config = mdbook:: Config :: default ( ) ;
60
60
61
- config. set ( "mdzk.backlinks-header" , self . mdzk . backlinks_header . clone ( ) ) . unwrap ( ) ;
61
+ config. set ( "mdzk.backlinks-header" , conf . mdzk . backlinks_header . clone ( ) ) . unwrap ( ) ;
62
62
63
- config. book = self . mdzk . into ( ) ;
64
- config. build = self . build . into ( ) ;
65
- config. rust = self . rust ;
63
+ config. book = conf . mdzk . into ( ) ;
64
+ config. build = conf . build . into ( ) ;
65
+ config. rust = conf . rust ;
66
66
67
- for ( key, value) in self . rest . as_table ( ) . unwrap ( ) . iter ( ) {
67
+ for ( key, value) in conf . rest . as_table ( ) . unwrap ( ) . iter ( ) {
68
68
// FIXME: Scary unwraps!
69
69
config. set ( key, value) . unwrap ( ) ;
70
70
}
@@ -168,15 +168,15 @@ impl Default for MdzkConfig {
168
168
}
169
169
}
170
170
171
- impl Into < BookConfig > for MdzkConfig {
172
- fn into ( self ) -> BookConfig {
173
- BookConfig {
174
- title : self . title ,
175
- authors : self . authors ,
176
- description : self . description ,
177
- src : self . src ,
178
- multilingual : self . multilingual ,
179
- language : self . language ,
171
+ impl From < MdzkConfig > for BookConfig {
172
+ fn from ( conf : MdzkConfig ) -> Self {
173
+ Self {
174
+ title : conf . title ,
175
+ authors : conf . authors ,
176
+ description : conf . description ,
177
+ src : conf . src ,
178
+ multilingual : conf . multilingual ,
179
+ language : conf . language ,
180
180
}
181
181
}
182
182
}
@@ -200,11 +200,11 @@ impl Default for BuildConfig {
200
200
}
201
201
}
202
202
203
- impl Into < mdbook:: config:: BuildConfig > for BuildConfig {
204
- fn into ( self ) -> mdbook :: config :: BuildConfig {
205
- mdbook :: config :: BuildConfig {
206
- build_dir : self . build_dir ,
207
- create_missing : self . create_missing ,
203
+ impl From < BuildConfig > for mdbook:: config:: BuildConfig {
204
+ fn from ( conf : BuildConfig ) -> Self {
205
+ Self {
206
+ build_dir : conf . build_dir ,
207
+ create_missing : conf . create_missing ,
208
208
// Override use_default_preprocessors config option. We are using our own versions of
209
209
// the defaults, controlled with `disable_default_preprocessors`.
210
210
use_default_preprocessors : false ,
0 commit comments