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

Going through all the documentation and trying to use #15

Merged
merged 5 commits into from
Jul 15, 2021

Conversation

CGMossa
Copy link
Contributor

@CGMossa CGMossa commented Jul 15, 2021

I really, really appreciate this package. And I wanted to go through it and
use the new way to refer to types in rustdoc. A few things have come up, that
would be nice if we could go through:

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 15, 2021

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 15, 2021

@zhiburt
Copy link
Owner

zhiburt commented Jul 15, 2021

Hi @CGMossa,
Thanks for opening the PR and your message.

Also, I don't really understand the ChangeRing: https://github.com/CGMossa/tabled/blob/d40f8307ab00f85ea5d02b4a2ff6708421d9c99f/src/lib.rs#L204-L205

ChangeRing is an old setting which was removed in regard of Format setting.
6573015#diff-a373be809d5fed898f6aa3a559af2601b9bd1c81ecb2a77be2821c77976a1312L47

So yes it certainly a bit outdated doc comment. Good catch 👍

@zhiburt
Copy link
Owner

zhiburt commented Jul 15, 2021

Overall I agree that documentation itself deserve to be polished.

@zhiburt
Copy link
Owner

zhiburt commented Jul 15, 2021

For instance this line here: https://github.com/CGMossa/tabled/blob/25c331008023fecce39736ef4e3ec2d0adbe6631/src/panel.rs#L5-L6

You can basically remove any row/column by Disable option (Look and ./README.md).
And I was thinking that Remove something after adding a row may cause issues but actually now I am thinking through it and it must be fine. I mean the comment should be deleted..

@zhiburt zhiburt added the documentation Improvements or additions to documentation label Jul 15, 2021
@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 15, 2021

Great! Thanks for the answer. I've removed these lines. Feel free to add any other suggestions, and merge it when you're happy with it.

Copy link
Owner

@zhiburt zhiburt left a comment

Choose a reason for hiding this comment

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

I actually like all your changes 💯

And I wasn't aware that when something is in scope you can refer on it in doc just like [something] so thanks for the lesson :)

But this feature brings compiler warnings. Wouldn't it be better to follow old fashioned (not actually) approach like this [Table]: ./struct.Table.html?

warning: unused import: `Table`
 --> src/alignment.rs:1:25
  |
1 | use crate::{CellOption, Table};
  |                         ^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `Table`
 --> src/disable.rs:1:30
  |
1 | use crate::{bounds_to_usize, Table, TableOption};
  |                              ^^^^^

warning: unused import: `papergrid::Grid`
 --> src/object.rs:6:5
  |
6 | use papergrid::Grid;
  |     ^^^^^^^^^^^^^^^

warning: unused import: `Disable`
 --> src/panel.rs:1:13
  |
1 | use crate::{Disable, TableOption};
  |             ^^^^^^^

warning: 4 warnings emitted

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 15, 2021

Based on what I've read here: rust-lang/rust#79542, I think we should just do with the #[allow(unused)].
I'm pushing a commit that does this now.

@CGMossa
Copy link
Contributor Author

CGMossa commented Jul 15, 2021

The same issue showcases a "better" pattern that is also discouraged in the same thread:

/// [`HashMap`]
///
/// [`HashMap`]: std::collections::HashMap
pub fn foo() {}

@zhiburt
Copy link
Owner

zhiburt commented Jul 15, 2021

Thanks for your PR.
And more importantly for your attention to the DOC. I'll try to work on it in a few days.

@zhiburt zhiburt merged commit 6b8faa4 into zhiburt:master Jul 15, 2021
@CGMossa CGMossa deleted the doc_refs branch July 15, 2021 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants