@@ -63,7 +63,6 @@ pub struct Options {
6363 pub no_js : bool ,
6464 pub no_metadata : bool ,
6565 pub no_video : bool ,
66- pub output : String ,
6766 pub silent : bool ,
6867 pub timeout : u64 ,
6968 pub unwrap_noscript : bool ,
@@ -102,12 +101,12 @@ const PLAINTEXT_MEDIA_TYPES: &[&str] = &[
102101] ;
103102
104103pub fn create_monolithic_document (
105- target : String ,
104+ source : String ,
106105 options : & Options ,
107106 mut cache : & mut Cache , // TODO: make it Option-al
108107) -> Result < Vec < u8 > , MonolithError > {
109- // Check if target was provided
110- if target . len ( ) == 0 {
108+ // Check if source was provided
109+ if source . len ( ) == 0 {
111110 return Err ( MonolithError :: new ( "no target specified" ) ) ;
112111 }
113112
@@ -123,7 +122,7 @@ pub fn create_monolithic_document(
123122
124123 let mut use_stdin: bool = false ;
125124
126- let target_url = match target . as_str ( ) {
125+ let target_url = match source . as_str ( ) {
127126 "-" => {
128127 // Read from pipe (stdin)
129128 use_stdin = true ;
@@ -150,26 +149,24 @@ pub fn create_monolithic_document(
150149 match Url :: from_file_path ( canonical_path) {
151150 Ok ( url) => url,
152151 Err ( _) => {
153- // eprintln!(
154- // "Could not generate file URL out of given path: {}",
155- // &target
156- // );
157- return Err ( MonolithError :: new (
158- "could not generate file URL out of given path" ,
159- ) ) ;
152+ return Err ( MonolithError :: new ( & format ! (
153+ "could not generate file URL out of given path \" {}\" " ,
154+ & target
155+ ) ) ) ;
160156 }
161157 }
162158 }
163159 false => {
164- // eprintln!("Local target is not a file: {}", &target);
165- return Err ( MonolithError :: new ( "local target is not a file" ) ) ;
160+ return Err ( MonolithError :: new ( & format ! (
161+ "local target \" {}\" is not a file" ,
162+ & target
163+ ) ) ) ;
166164 }
167165 } ,
168166 false => {
169167 // It is not a FS path, now we do what browsers do:
170168 // prepend "http://" and hope it points to a website
171- Url :: parse ( & format ! ( "http://{hopefully_url}" , hopefully_url = & target) )
172- . unwrap ( )
169+ Url :: parse ( & format ! ( "http://{}" , & target) ) . unwrap ( )
173170 }
174171 }
175172 }
0 commit comments