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

Fix clippy warnings #122

Merged
merged 3 commits into from
May 4, 2024
Merged

Fix clippy warnings #122

merged 3 commits into from
May 4, 2024

Conversation

progval
Copy link
Collaborator

@progval progval commented Apr 20, 2024

In addition to #121, I left these issues unfixed because I'm not sure what to do about them:

warning: this function has too many arguments (8/7)
  --> sable_server/src/run.rs:75:1
   |
75 | / async fn do_run_server<ST>(
76 | |     server_conf_path: impl AsRef<Path>,
77 | |     server_config: ServerConfig<ST>,
78 | |     processed_server_config: ST::ProcessedConfig,
...  |
85 | | where
86 | |     ST: ServerType,
   | |___________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
   = note: `#[warn(clippy::too_many_arguments)]` on by default

warning: `sable_server` (lib) generated 1 warning
    Checking sable_ircd v0.1.0 (/home/dev-sable/sable/sable_ircd)
warning: you should consider adding a `Default` implementation for `AtomicCapabilitySet`
   --> sable_ircd/src/capability/mod.rs:131:5
    |
131 | /     pub fn new() -> Self {
132 | |         Self(AtomicU64::new(0))
133 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
    = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
    |
130 + impl Default for AtomicCapabilitySet {
131 +     fn default() -> Self {
132 +         Self::new()
133 +     }
134 + }
    |

warning: methods called `is_*` usually take `self` by mutable reference or `self` by reference or no `self`
  --> sable_ircd/src/command/plumbing/conditional_argument_types.rs:58:23
   |
58 |     pub fn is_present(self) -> Option<T> {
   |                       ^^^^
   |
   = help: consider choosing a less ambiguous name
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
   = note: `#[warn(clippy::wrong_self_convention)]` on by default

warning: this function has too many arguments (8/7)
   --> sable_ircd/src/command/handlers/chathistory.rs:294:1
    |
294 | / fn send_history_for_target_forward(
295 | |     server: &ClientServer,
296 | |     into: impl MessageSink,
297 | |     source: &wrapper::User,
...   |
302 | |     limit: Option<usize>,
303 | | ) -> CommandResult {
    | |__________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
    = note: `#[warn(clippy::too_many_arguments)]` on by default

warning: this function has too many arguments (8/7)
   --> sable_ircd/src/command/handlers/chathistory.rs:332:1
    |
332 | / fn send_history_for_target_reverse(
333 | |     server: &ClientServer,
334 | |     into: impl MessageSink,
335 | |     source: &wrapper::User,
...   |
340 | |     limit: Option<usize>,
341 | | ) -> CommandResult {
    | |__________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

warning: you should consider adding a `Default` implementation for `AsyncHandlerCollection<'a>`
  --> sable_ircd/src/server/async_handler_collection.rs:10:5
   |
10 | /     pub fn new() -> Self {
11 | |         Self {
12 | |             futures: FuturesUnordered::new(),
13 | |         }
14 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
9  + impl<'a> Default for AsyncHandlerCollection<'a> {
10 +     fn default() -> Self {
11 +         Self::new()
12 +     }
13 + }
   |

warning: `sable_ircd` (lib) generated 5 warnings (run `cargo clippy --fix --lib -p sable_ircd` to apply 2 suggestions)
    Finished dev [unoptimized + debuginfo] target(s) in 4.16s

@spb spb merged commit cdf1f6e into Libera-Chat:master May 4, 2024
2 checks passed
@progval progval deleted the clippy branch November 11, 2024 09:48
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.

2 participants