@@ -89,12 +89,9 @@ edition = "2021"
89
89
let src_path = temp_dir_path. join ( "src" ) ;
90
90
create_dir_all ( & src_path) ?;
91
91
File :: create ( src_path. join ( "lib.rs" ) ) ?;
92
- eprintln ! ( "[DEBUG] Created empty src/lib.rs at: {}" , src_path. join( "lib.rs" ) . display( ) ) ;
93
92
94
93
let mut temp_manifest_file = File :: create ( & temp_manifest_path) ?;
95
94
temp_manifest_file. write_all ( cargo_toml_content. as_bytes ( ) ) ?;
96
- eprintln ! ( "[DEBUG] Created temporary manifest at: {}" , temp_manifest_path. display( ) ) ;
97
- eprintln ! ( "[DEBUG] Temporary Manifest Content:\n {}" , cargo_toml_content) ; // Log content
98
95
99
96
100
97
// --- Use Cargo API ---
@@ -115,10 +112,8 @@ edition = "2021"
115
112
116
113
// Use the temporary manifest path for the Workspace
117
114
let mut ws = Workspace :: new ( & temp_manifest_path, & config) ?; // Make ws mutable
118
- eprintln ! ( "[DEBUG] Workspace target dir before set: {}" , ws. target_dir( ) . as_path_unlocked( ) . display( ) ) ;
119
115
// Set target_dir directly on Workspace
120
116
ws. set_target_dir ( cargo:: util:: Filesystem :: new ( temp_dir_path. to_path_buf ( ) ) ) ;
121
- eprintln ! ( "[DEBUG] Workspace target dir after set: {}" , ws. target_dir( ) . as_path_unlocked( ) . display( ) ) ;
122
117
123
118
// Create CompileOptions, relying on ::new for BuildConfig
124
119
let mut compile_opts = CompileOptions :: new ( & config, cargo:: core:: compiler:: CompileMode :: Doc { deps : false , json : false } ) ?;
@@ -133,40 +128,30 @@ edition = "2021"
133
128
open_result : false , // Don't open in browser
134
129
output_format : ops:: OutputFormat :: Html ,
135
130
} ;
136
- eprintln ! ( "[DEBUG] package_spec for CompileOptions: '{}'" , package_spec) ;
137
131
138
- // Debug print relevant options before calling ops::doc
139
- eprintln ! ( "[DEBUG] CompileOptions spec: {:?}" , doc_opts. compile_opts. spec) ;
140
- eprintln ! ( "[DEBUG] CompileOptions cli_features: {:?}" , doc_opts. compile_opts. cli_features) ; // Features for temp crate
141
- eprintln ! ( "[DEBUG] CompileOptions build_config mode: {:?}" , doc_opts. compile_opts. build_config. mode) ;
142
- eprintln ! ( "[DEBUG] DocOptions output_format: {:?}" , doc_opts. output_format) ;
143
132
144
133
ops:: doc ( & ws, & doc_opts) . map_err ( DocLoaderError :: CargoLib ) ?; // Use ws
145
134
// --- End Cargo API ---
146
135
147
136
// --- Find the actual documentation directory ---
148
137
// Iterate through subdirectories in `target/doc` and find the one containing `index.html`.
149
138
let base_doc_path = temp_dir_path. join ( "doc" ) ;
150
- eprintln ! ( "[DEBUG] Base doc path: {}" , base_doc_path. display( ) ) ;
151
139
152
140
let mut target_docs_path: Option < PathBuf > = None ;
153
141
let mut found_count = 0 ;
154
142
155
143
if base_doc_path. is_dir ( ) {
156
144
for entry_result in fs:: read_dir ( & base_doc_path) ? {
157
145
let entry = entry_result?;
158
- eprintln ! ( "[DEBUG] Checking directory entry: {}" , entry. path( ) . display( ) ) ; // Log entry being checked
159
146
if entry. file_type ( ) ?. is_dir ( ) {
160
147
let dir_path = entry. path ( ) ;
161
148
let index_html_path = dir_path. join ( "index.html" ) ;
162
149
if index_html_path. is_file ( ) {
163
- eprintln ! ( "[DEBUG] Found potential docs directory with index.html: {}" , dir_path. display( ) ) ;
164
150
if target_docs_path. is_none ( ) {
165
151
target_docs_path = Some ( dir_path) ;
166
152
}
167
153
found_count += 1 ;
168
154
} else {
169
- eprintln ! ( "[DEBUG] Skipping directory without index.html: {}" , dir_path. display( ) ) ;
170
155
}
171
156
}
172
157
}
@@ -198,9 +183,6 @@ edition = "2021"
198
183
// This might need adjustment based on the exact rustdoc version/theme
199
184
let content_selector = Selector :: parse ( "section#main-content.content" )
200
185
. map_err ( |e| DocLoaderError :: Selector ( e. to_string ( ) ) ) ?;
201
- eprintln ! ( "[DEBUG] Calculated final docs_path: {}" , docs_path. display( ) ) ;
202
-
203
- eprintln ! ( "Starting document loading from: {}" , docs_path. display( ) ) ;
204
186
205
187
for entry in WalkDir :: new ( & docs_path)
206
188
. into_iter ( )
0 commit comments