Skip to content

Fix clippy pedantic warnings on the async module #43

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

Closed
cljoly opened this issue Feb 28, 2023 · 3 comments · Fixed by #44
Closed

Fix clippy pedantic warnings on the async module #43

cljoly opened this issue Feb 28, 2023 · 3 comments · Fixed by #44

Comments

@cljoly
Copy link
Owner

cljoly commented Feb 28, 2023

Current issues:

warning: this method could have a `#[must_use]` attribute
  --> rusqlite_migration/src/asynch.rs:25:5
   |
25 |     pub fn new(ms: Vec<M<'static>>) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(ms: Vec<M<'static>>) -> Self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
   = note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic`

warning: docs for function returning `Result` missing `# Errors` section
  --> rusqlite_migration/src/asynch.rs:55:5
   |
55 |     pub async fn current_version(&self, async_conn: &AsyncConnection) -> Result<SchemaVersion> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
   = note: `-W clippy::missing-errors-doc` implied by `-W clippy::pedantic`

warning: docs for function returning `Result` missing `# Errors` section
  --> rusqlite_migration/src/asynch.rs:82:5
   |
82 |     pub async fn to_latest(&self, async_conn: &mut AsyncConnection) -> Result<()> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: docs for function returning `Result` missing `# Errors` section
   --> rusqlite_migration/src/asynch.rs:116:5
    |
116 |     pub async fn to_version(&self, async_conn: &mut AsyncConnection, version: usize) -> Result<()> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: docs for function returning `Result` missing `# Errors` section
   --> rusqlite_migration/src/asynch.rs:139:5
    |
139 |     pub async fn validate(&self) -> Result<()> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

warning: `rusqlite_migration` (lib) generated 5 warnings

Some can silenced maybe? Like the doc ones, when we merely link to the sync method?

@cljoly
Copy link
Owner Author

cljoly commented Feb 28, 2023

This is a follow-up of #29

czocher added a commit to czocher/rusqlite_migration that referenced this issue Mar 12, 2023
@czocher
Copy link
Collaborator

czocher commented Mar 12, 2023

Created a PR to fix this problem :). I found no way to show clippy that there's a related doc, but ignoring the warning is safe in this situation AFAIK.

@cljoly
Copy link
Owner Author

cljoly commented Mar 13, 2023

but ignoring the warning is safe in this situation AFAIK.

Yeah, looking at the PR it seems safe (the error case is documented in the blocking version).

cljoly pushed a commit that referenced this issue Mar 13, 2023
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 a pull request may close this issue.

2 participants