Skip to content

refactor(crate): split library exports into lib.rs#73

Closed
shivv23 wants to merge 1 commit intoc2siorg:mainfrom
shivv23:codex/pr1-crate-layout-cleanup
Closed

refactor(crate): split library exports into lib.rs#73
shivv23 wants to merge 1 commit intoc2siorg:mainfrom
shivv23:codex/pr1-crate-layout-cleanup

Conversation

@shivv23
Copy link
Copy Markdown

@shivv23 shivv23 commented Mar 13, 2026

Summary

This PR refactors crate structure to make rustcloud a proper library crate surface and removes manifest noise that can confuse builds/tooling.

Changes

  • Added src/lib.rs as the canonical module export surface.
  • Simplified src/main.rs to a minimal binary entrypoint.
  • Removed invalid Cargo.toml entries:
    • self-referential dev dependency on rustcloud
    • editor-only [[language]] block
  • Removed stale module declarations pointing to missing files in AWS modules.
  • Fixed gcp_storage response handling for reqwest 0.12 (capture status before consuming response body).

Why

  • Improves crate correctness and downstream usability as a library.
  • Removes non-Cargo metadata from manifest.
  • Avoids compile issues caused by missing module declarations and moved Response values.

Validation

  • cargo check --lib

Copy link
Copy Markdown
Contributor

@Sandipmandal25 Sandipmandal25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread rustcloud/src/lib.rs
pub mod gcp;
pub mod traits;
pub mod types;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread rustcloud/src/lib.rs
pub mod gcp;
pub mod traits;
pub mod types;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

digiocean, azure sub-modules and gcp::gcp_apis::artificial_intelligence::vertex are missing — they were in main.rs but not carried over here.

Comment thread rustcloud/src/lib.rs
pub mod types;

#[cfg(test)]
mod tests;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests use crate:: paths worth verifying all imports still resolve correctly now that crate root is lib.rs instead of main.rs.

Comment thread rustcloud/src/main.rs
@@ -1,97 +1,3 @@
mod tests;
pub mod errors;
pub mod types {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@shivv23
Copy link
Copy Markdown
Author

shivv23 commented Mar 22, 2026

@Sandipmandal25 @PratikDhanave Resolved these issues in PR#121

@Sandipmandal25
Copy link
Copy Markdown
Contributor

@Sandipmandal25 @PratikDhanave Resolved these issues in PR#121

thanks for the context @shivv23
but the standard practice when review feedback is raised on a PR is to push the fixes to the same PR, not
open a new PR. PR #73 is still open alongside PR #121, both doing the same thing. One of them should be closed to avoid a duplicate merge conflict. Opening a new PR for every round of feedback will make the PR list unmanageable. so please close this pr if you are resolving the reviews of this pr in a new pr.

@shivv23
Copy link
Copy Markdown
Author

shivv23 commented Mar 23, 2026

Closing - consolidated into PR #124 @Sandipmandal25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants