Skip to content

Fix clippy warnings in rust 1.80-beta#3355

Merged
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:workspace-lints
Jun 12, 2024
Merged

Fix clippy warnings in rust 1.80-beta#3355
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:workspace-lints

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Jun 12, 2024

Example:

warning: doc list item missing indentation
   --> lib/vasi-sync/src/scchannel.rs:144:5
    |
144 | /// single-consumer channel.
    |     ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
    = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
    |
144 | ///   single-consumer channel.
    |     ++

(Aside:)

If anyone finds them useful, these are the vim settings I use for formatting rust comments, and they seem to work fairly well. Figured I'd might as well post them here:

" fix gq formatting: https://stackoverflow.com/a/28078855
autocmd Filetype rust set comments^=:///
autocmd Filetype rust set comments^=://!
" and for quote comments
autocmd Filetype rust set comments^=:///\ >
autocmd Filetype rust set comments^=://\ >
" wrap comments but not text
autocmd Filetype rust set formatoptions+=c
autocmd Filetype rust set formatoptions-=t
" https://stackoverflow.com/questions/37149002/vim-indenting-bullet-lists-within-comments-in-python
autocmd FileType rust,c,python set formatoptions+=n
autocmd FileType rust,c,python set formatlistpat=^\\s*[\\-\\+\\*]\\+\\s\\+

Example:

```
warning: doc list item missing indentation
   --> lib/vasi-sync/src/scchannel.rs:144:5
    |
144 | /// single-consumer channel.
    |     ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
    = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
    |
144 | ///   single-consumer channel.
    |     ++
```
@stevenengler stevenengler requested a review from sporksmith June 12, 2024 17:28
@stevenengler stevenengler self-assigned this Jun 12, 2024
@github-actions github-actions bot added Component: Libraries Support functions like LD_PRELOAD and logging Component: Main Composing the core Shadow executable labels Jun 12, 2024
@stevenengler stevenengler enabled auto-merge June 12, 2024 17:28
@stevenengler stevenengler merged commit 41f9e58 into shadow:main Jun 12, 2024
@stevenengler stevenengler deleted the workspace-lints branch June 12, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Libraries Support functions like LD_PRELOAD and logging Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants