@@ -50,16 +50,17 @@ struct DocsCode {
5050 wrapper_end : Option < String > ,
5151}
5252
53-
54-
5553#[ cfg( not( tarpaulin_include) ) ]
5654#[ cfg( feature = "client" ) ]
5755fn read_input ( input : & str ) -> AppResult < String > {
5856 if input. starts_with ( "http://" ) || input. starts_with ( "https://" ) {
59- let mut response = ureq:: get ( input)
57+ let response = ureq:: get ( input)
6058 . call ( )
6159 . map_err ( |e| AppError :: General ( format ! ( "Failed to fetch URL: {}" , e) ) ) ?;
62- response. into_string ( ) . map_err ( |e| AppError :: General ( format ! ( "Failed to read HTTP body: {}" , e) ) )
60+ response
61+ . into_body ( )
62+ . read_to_string ( )
63+ . map_err ( |e| AppError :: General ( format ! ( "Failed to read HTTP body: {}" , e) ) )
6364 } else {
6465 std:: fs:: read_to_string ( input)
6566 . map_err ( |e| AppError :: General ( format ! ( "Failed to read file: {}" , e) ) )
@@ -70,7 +71,9 @@ fn read_input(input: &str) -> AppResult<String> {
7071#[ cfg( not( feature = "client" ) ) ]
7172fn read_input ( input : & str ) -> AppResult < String > {
7273 if input. starts_with ( "http://" ) || input. starts_with ( "https://" ) {
73- Err ( AppError :: General ( "Client feature is not compiled, cannot fetch HTTP URLs" . to_string ( ) ) )
74+ Err ( AppError :: General (
75+ "Client feature is not compiled, cannot fetch HTTP URLs" . to_string ( ) ,
76+ ) )
7477 } else {
7578 std:: fs:: read_to_string ( input)
7679 . map_err ( |e| AppError :: General ( format ! ( "Failed to read file: {}" , e) ) )
0 commit comments