File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ fn main() {
7878fn process_module_type (
7979 titles : clap:: Values ,
8080 module_type_str : & str ,
81- options : & ' static Options ,
81+ options : & Options ,
8282) -> Vec < Module > {
8383 let mut modules_from_type = Vec :: new ( ) ;
8484
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ pub enum ModuleType {
1414pub struct Input {
1515 mod_type : ModuleType ,
1616 title : String ,
17- options : & ' static Options ,
17+ options : Options ,
1818 includes : Option < Vec < String > > ,
1919}
2020
@@ -38,8 +38,9 @@ const REFERENCE_TEMPLATE: &str = include_str!("../templates/reference.adoc");
3838
3939
4040impl Input {
41- pub fn new ( mod_type : ModuleType , title : & str , options : & ' static Options ) -> Input {
41+ pub fn new ( mod_type : ModuleType , title : & str , options : & Options ) -> Input {
4242 let title = String :: from ( title) ;
43+ let options = options. clone ( ) ;
4344
4445 Input {
4546 mod_type,
@@ -236,7 +237,7 @@ impl From<Input> for Module {
236237
237238impl Module {
238239 /// The constructor for the Module struct
239- pub fn new ( mod_type : ModuleType , title : & str , options : & ' static Options ) -> Module {
240+ pub fn new ( mod_type : ModuleType , title : & str , options : & Options ) -> Module {
240241 let input = Input :: new ( mod_type, title, options) ;
241242 input. into ( )
242243 }
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ use crate::module::Module;
99
1010impl Module {
1111 /// Write the generated module content to the path specified in `options` with the set file name.
12- pub fn write_file ( & self ) {
12+ pub fn write_file ( & self , options : & Options ) {
1313 // Compose the full (but still relative) file path from the target directory and the file name
14- let full_path_buf: PathBuf = [ & self . options . target_dir , & self . file_name ] . iter ( ) . collect ( ) ;
14+ let full_path_buf: PathBuf = [ & options. target_dir , & self . file_name ] . iter ( ) . collect ( ) ;
1515 let full_path = full_path_buf. as_path ( ) ;
1616
1717 // If the target file already exists, just print out an error
You can’t perform that action at this time.
0 commit comments