@@ -37,22 +37,22 @@ pub struct Document {
3737/// Generates documentation for a given crate in a temporary directory,
3838/// then loads and parses the HTML documents.
3939/// Extracts text content from the main content area of rustdoc generated HTML.
40- pub fn load_documents ( crate_name : & str , crate_version : & str ) -> Result < Vec < Document > , DocLoaderError > { // Use crate_version
41- eprintln ! ( "[DEBUG] load_documents called with crate_name: '{}', crate_version : '{}'" , crate_name, crate_version ) ;
40+ pub fn load_documents ( crate_name : & str , crate_version_req : & str ) -> Result < Vec < Document > , DocLoaderError > { // Use crate_version_req
41+ eprintln ! ( "[DEBUG] load_documents called with crate_name: '{}', crate_version_req : '{}'" , crate_name, crate_version_req ) ; // Update log
4242 let mut documents = Vec :: new ( ) ;
4343
4444 let temp_dir = tempdir ( ) . map_err ( DocLoaderError :: TempDirCreationFailed ) ?;
4545 let temp_dir_path = temp_dir. path ( ) ;
4646 let temp_manifest_path = temp_dir_path. join ( "Cargo.toml" ) ;
4747
4848 eprintln ! (
49- "Generating documentation for crate '{}' version '{}' in temporary directory: {}" ,
49+ "Generating documentation for crate '{}' (Version Req: '{}') in temporary directory: {}" , // Update log message
5050 crate_name,
51- crate_version ,
51+ crate_version_req ,
5252 temp_dir_path. display( )
5353 ) ;
5454
55- // Create a temporary Cargo.toml
55+ // Create a temporary Cargo.toml using the version requirement
5656 let cargo_toml_content = format ! (
5757 r#"[package]
5858name = "temp-doc-crate"
@@ -64,7 +64,7 @@ edition = "2021"
6464[dependencies]
6565{} = "{}"
6666"# ,
67- crate_name, crate_version
67+ crate_name, crate_version_req // Use the version requirement string here
6868 ) ;
6969
7070 // Create the src directory and an empty lib.rs file
0 commit comments