Skip to content

Commit

Permalink
style: 🚚 cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason0729 committed Nov 26, 2023
1 parent 4f4710b commit 7dafb69
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/src/endpoint/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::endpoint::util::hash;
use crate::grpc::backend::user_set_server::*;
use crate::grpc::backend::*;

use entity::token;

use entity::user;
use entity::user::*;

Expand Down Expand Up @@ -247,7 +247,7 @@ impl UserSet for Arc<Server> {
) -> Result<Response<()>, Status> {
let db = DB.get().unwrap();
let (auth, req) = self.parse_request(req).await?;
let (user_id, perm) = auth.ok_or_default()?;
let (user_id, _) = auth.ok_or_default()?;

let model = user::Entity::find()
.filter(user::Column::Username.eq(req.username))
Expand Down
2 changes: 1 addition & 1 deletion backend/src/endpoint/util/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use thiserror::Error;
use tokio::sync::broadcast::error;


#[derive(Debug, Error)]
pub enum Error {
Expand Down
8 changes: 4 additions & 4 deletions backend/src/endpoint/util/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ pub trait Filter
where
Self: EntityTrait,
{
fn read_filter<S: QueryFilter + Send>(query: S, auth: &Auth) -> Result<S, Error> {
fn read_filter<S: QueryFilter + Send>(_: S, _: &Auth) -> Result<S, Error> {
Err(Error::Unauthenticated)
}
fn write_filter<S: QueryFilter + Send>(query: S, auth: &Auth) -> Result<S, Error> {
fn write_filter<S: QueryFilter + Send>(_: S, _: &Auth) -> Result<S, Error> {
Err(Error::Unauthenticated)
}
}

pub trait ParentalFilter {
fn publish_filter<S: QueryFilter + Send>(query: S, auth: &Auth) -> Result<S, Error> {
fn publish_filter<S: QueryFilter + Send>(_: S, _: &Auth) -> Result<S, Error> {
Err(Error::Unauthenticated)
}
fn link_filter<S: QueryFilter + Send>(query: S, auth: &Auth) -> Result<S, Error> {
fn link_filter<S: QueryFilter + Send>(_: S, _: &Auth) -> Result<S, Error> {
Err(Error::Unauthenticated)
}
}
2 changes: 1 addition & 1 deletion backend/src/endpoint/util/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn into_tokiostream<O: Send + 'static>(
let (tx, rx) = channel(128);

tokio::spawn(async move {
while let Some(item) = iter.next() {
for item in iter.by_ref() {
if tx.send(Result::<_, tonic::Status>::Ok(item)).await.is_err() {
break;
}
Expand Down

0 comments on commit 7dafb69

Please sign in to comment.