- rustup component add clippy
- cargo clippy --workspace --tests --all-targets --all-features --
-D warnings -D deprecated -D clippy::perf -D clippy::complexity
+ -D clippy::style -D clippy::correctness -D clippy::suspicious
-D clippy::dbg_macro -D clippy::inefficient_to_string
-D clippy::items-after-statements -D clippy::implicit_clone
-D clippy::wildcard_imports -D clippy::cast_lossless
- -D clippy::manual_string_new -D clippy::redundant_closure_for_method_calls
+ -D clippy::manual_string_new -D clippy::redundant_closure_for_method_calls
+ -D clippy::unused_self
- cargo clippy --workspace --all-features -- -D clippy::unwrap_used
- name: cargo test
license = "AGPL-3.0"
homepage = "https://join-lemmy.org/"
documentation = "https://join-lemmy.org/docs/en/index.html"
+repository = "https://github.com/LemmyNet/lemmy"
[package]
name = "lemmy_server"
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
doctest = false
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
name = "lemmy_api"
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
name = "lemmy_api_common"
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[dependencies]
lemmy_apub = { workspace = true }
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
name = "lemmy_apub"
) -> Result<HttpResponse, LemmyError> {
let person = Person::read_from_name(context.pool(), &info.user_name, false).await?;
let outbox_id = generate_outbox_url(&person.actor_id)?.into();
- let outbox = EmptyOutbox::new(outbox_id).await?;
+ let outbox = EmptyOutbox::new(outbox_id)?;
Ok(create_apub_response(&outbox))
}
"{}/site_outbox",
context.settings().get_protocol_and_hostname()
);
- let outbox = EmptyOutbox::new(Url::parse(&outbox_id)?).await?;
+ let outbox = EmptyOutbox::new(Url::parse(&outbox_id)?)?;
Ok(create_apub_response(&outbox))
}
}
impl EmptyOutbox {
- pub(crate) async fn new(outbox_id: Url) -> Result<EmptyOutbox, LemmyError> {
+ pub(crate) fn new(outbox_id: Url) -> Result<EmptyOutbox, LemmyError> {
Ok(EmptyOutbox {
r#type: OrderedCollectionType::OrderedCollection,
id: outbox_id,
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
name = "lemmy_db_schema"
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
doctest = false
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
doctest = false
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
doctest = false
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
doctest = false
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
name = "lemmy_utils"
license.workspace = true
homepage.workspace = true
documentation.workspace = true
+repository.workspace = true
[lib]
name = "lemmy_websocket"
/// We register ws session with ChatServer
fn started(&mut self, ctx: &mut Self::Context) {
// we'll start heartbeat process on session start.
- self.hb(ctx);
+ WsSession::hb(ctx);
// register self in chat server. `AsyncContext::wait` register
// future within context, but context waits until this future resolves
/// helper method that sends ping to client every second.
///
/// also this method checks heartbeats from client
- fn hb(&self, ctx: &mut ws::WebsocketContext<Self>) {
+ fn hb(ctx: &mut ws::WebsocketContext<Self>) {
ctx.run_interval(HEARTBEAT_INTERVAL, |act, ctx| {
// check client heartbeats
if Instant::now().duration_since(act.hb) > CLIENT_TIMEOUT {
#!/bin/bash
set -e
-cargo clippy --workspace --fix --allow-dirty --tests --all-targets --all-features -- \
+cargo clippy --workspace --fix --allow-staged --tests --all-targets --all-features -- \
-D warnings -D deprecated -D clippy::perf -D clippy::complexity \
+ -D clippy::style -D clippy::correctness -D clippy::suspicious \
-D clippy::dbg_macro -D clippy::inefficient_to_string \
-D clippy::items-after-statements -D clippy::implicit_clone \
-D clippy::wildcard_imports -D clippy::cast_lossless \
- -D clippy::manual_string_new -D clippy::redundant_closure_for_method_calls
+ -D clippy::manual_string_new -D clippy::redundant_closure_for_method_calls \
+ -D clippy::unused_self