Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rustdoc to connect crate #1455

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

photovoltex
Copy link
Member

@photovoltex photovoltex commented Jan 21, 2025

I think I initially tried to enforce rustdoc on the whole project, but that just is in insane task at this stage.

Well anyhow... I got around to add rustdoc for the connect crate and additionally a cleanup of the exposed items, so that only the necessary are exposed.

I also had to change up the CHANGELOG.md as some previous entries where are out of that with the cleanup changes.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.

Files not reviewed (6)
  • CHANGELOG.md: Evaluated as low risk
  • connect/README.md: Evaluated as low risk
  • connect/src/lib.rs: Evaluated as low risk
  • connect/src/model.rs: Evaluated as low risk
  • connect/src/state/metadata.rs: Evaluated as low risk
  • src/main.rs: Evaluated as low risk

core/src/session.rs Outdated Show resolved Hide resolved
Copy link
Member

@roderickvd roderickvd left a comment

Choose a reason for hiding this comment

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

Quite the effort to get everything documented!

connect/src/model.rs Outdated Show resolved Hide resolved
connect/src/spirc.rs Show resolved Hide resolved
connect/src/spirc.rs Outdated Show resolved Hide resolved
@roderickvd roderickvd assigned photovoltex and unassigned roderickvd Jan 22, 2025
@roderickvd
Copy link
Member

When you're looking for anyone's review, you can specifically request / add them as reviewers and keep the assignee as yourself.

@photovoltex
Copy link
Member Author

When you're looking for anyone's review, you can specifically request / add them as reviewers and keep the assignee as yourself.

Okay will do! You just said in another message that I should assigning you, but I suppose I mistook assigning to the PR with review assigning.

@photovoltex
Copy link
Member Author

Oh and big thanks for the review @roderickvd :D

@photovoltex photovoltex force-pushed the connect-docs branch 2 times, most recently from fd6de96 to bed00a6 Compare January 23, 2025 20:56
when awaited.

To get an understanding how to handle the `SpircTask`, it is recommended to take look
at the code of the `librespot` binary. As the [`src/main.rs`](https://github.com/librespot-org/librespot/blob/dev/src/main.rs#L1943)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe link this to a specific commit, so we can be sure the reference to this line remains as we expect?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, fair point. I wanted to point to up-to-date code, so that the reference doesn't get outdated. But I can also see the appeal of a specific commit. In the end it's probably better to point in a general direction, then an outdated I would say. Who knows when these initial docs may run out of sync.

But the same argument can probably be made if someone refactors the main.rs file into smaller files. If you have a strong stance on a specific commit I will change it, otherwise I would keep it as is.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we extract it into a new example?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a minimal compilable version here in the README (so that you have an example on docs.rs). But for a greater picture I just point to a working version, which is as currently the binary.

But yeah in general an own example would be technically better... Yeah why not! I had the thought initially, but wanted to only provided an example in the README (probably laziness). Tho it's probably better to point to a static point, as the example will hopefully not change as the binary will.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering if there is any rust tooling that takes examples and inserts them into rustdoc automatically when you publish the crate. I think Python has stuff like that. I did find found rust-lang/rust#88791 which looks cool.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well actually there was already an example I didn't fully noticed so far. I updated it a bit and referenced it in the README now.

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.

3 participants