rust3ds / ctru-rs

Rust wrapper for libctru
https://rust3ds.github.io/ctru-rs/
Other
116 stars 17 forks source link

Improve documentation and examples #134

Closed Meziu closed 11 months ago

Meziu commented 1 year ago

Closes #32

Finally, the long awaited "documentation PR" I have so much anticipated has come.

This PR's changes boil down to:

And most importantly:

I suggest you review this PR mostly by looking at the result of the cargo 3ds doc compilation, since the git diff is huge.

This PR took me weeks of work and it marks one big milestone for this project (in some cases, the new docs are actually better than libctru's official ones :P ).

Thanks for your attention. I may finally go puke in a nearby bucket. Writing docs is nauseous 🤮 .

FenrirWolf commented 1 year ago

When I check out the branch and run cargo 3ds doc --open, I get the following error from shim_3ds that prevents the docs from fully building:

error[E0432]: unresolved import `ctru_sys::__errno`
 --> /home/fenrir/.cargo/git/checkouts/shim-3ds-0fd8aff15f8f05f2/2d3ebe6/src/lib.rs:3:5
  |
3 | use ctru_sys::__errno;
  |     ^^^^^^^^^^-------
  |     |         |
  |     |         help: a similar name exists in the module: `errno`
  |     no `__errno` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `shim-3ds` (lib) due to previous error
Meziu commented 1 year ago

When I check out the branch and run cargo 3ds doc --open, I get the following error from shim_3ds that prevents the docs from fully building:

error[E0432]: unresolved import `ctru_sys::__errno`
 --> /home/fenrir/.cargo/git/checkouts/shim-3ds-0fd8aff15f8f05f2/2d3ebe6/src/lib.rs:3:5
  |
3 | use ctru_sys::__errno;
  |     ^^^^^^^^^^-------
  |     |         |
  |     |         help: a similar name exists in the module: `errno`
  |     no `__errno` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `shim-3ds` (lib) due to previous error

You probably need to update your git cache. It’s been updated a while ago. cargo update should do the trick.

FenrirWolf commented 1 year ago

That's the thing though, I can build and read the docs just fine on the latest master but not on this branch. Same thing after running cargo update too.

Meziu commented 1 year ago

That's the thing though, I can build and read the docs just fine on the latest master but not on this branch. Same thing after running cargo update too.

I don’t really know what to tell you except cargo clean and cargo update. The function is very much there and even the CI (which uses a fresh environment) can build the documentation just fine.

FenrirWolf commented 12 months ago

Got them building after nuking my local project and then checking the branch out again. Not sure what that was about but at least the problem's gone now 😆

FenrirWolf commented 12 months ago

Other than typos and some suggestions from Github Actions that might be worth implementing, I'd say that this looks good to me