refactor(crate): split library exports into lib.rs#73
refactor(crate): split library exports into lib.rs#73shivv23 wants to merge 1 commit intoc2siorg:mainfrom
Conversation
Sandipmandal25
left a comment
There was a problem hiding this comment.
a library crate should expose its public API through lib.rs, not main.rs. However the implementation is incomplete and will not compile as submitted.
| pub mod gcp; | ||
| pub mod traits; | ||
| pub mod types; | ||
|
|
There was a problem hiding this comment.
pub mod aws alone won't resolve nested paths like aws::aws_apis::compute::aws_ec2. Need src/aws/mod.rs and src/aws/aws_apis/mod.rs declaring all sub-modules, otherwise this won't compile.
| pub mod gcp; | ||
| pub mod traits; | ||
| pub mod types; | ||
|
|
There was a problem hiding this comment.
digiocean, azure sub-modules and gcp::gcp_apis::artificial_intelligence::vertex are missing — they were in main.rs but not carried over here.
| pub mod types; | ||
|
|
||
| #[cfg(test)] | ||
| mod tests; |
There was a problem hiding this comment.
Tests use crate:: paths worth verifying all imports still resolve correctly now that crate root is lib.rs instead of main.rs.
| @@ -1,97 +1,3 @@ | |||
| mod tests; | |||
| pub mod errors; | |||
| pub mod types { | |||
There was a problem hiding this comment.
All sub-module declarations removed but the mod.rs files to replace them are not added in this PR. This will fail to compile until those are added.
Summary
This PR refactors crate structure to make
rustclouda proper library crate surface and removes manifest noise that can confuse builds/tooling.Changes
src/lib.rsas the canonical module export surface.src/main.rsto a minimal binary entrypoint.Cargo.tomlentries:rustcloud[[language]]blockgcp_storageresponse handling forreqwest0.12 (capture status before consuming response body).Why
Responsevalues.Validation
cargo check --lib