🚨 Fix clippy warnings
This commit is contained in:
@@ -291,13 +291,9 @@ impl Client {
|
||||
let joined_matrix_rooms_ref = &matrix_client.joined_rooms();
|
||||
let invited_matrix_rooms_ref = &matrix_client.invited_rooms();
|
||||
|
||||
for matrix_rooms in vec![joined_matrix_rooms_ref, invited_matrix_rooms_ref] {
|
||||
for matrix_rooms in [joined_matrix_rooms_ref, invited_matrix_rooms_ref] {
|
||||
for matrix_room in matrix_rooms.iter() {
|
||||
let topic = match matrix_room.topic() {
|
||||
None => None,
|
||||
Some(topic) => Some(RefCell::new(topic)),
|
||||
};
|
||||
|
||||
let topic = matrix_room.topic().map(RefCell::new);
|
||||
let room = Room::new(
|
||||
Arc::new(matrix_room.to_owned()),
|
||||
topic,
|
||||
@@ -405,7 +401,7 @@ impl Client {
|
||||
async fn run(&mut self, task: WorkerTask) {
|
||||
match task {
|
||||
WorkerTask::Init(reply) => {
|
||||
assert_eq!(self.initialized, false);
|
||||
assert!(!self.initialized);
|
||||
self.init();
|
||||
reply.send(());
|
||||
}
|
||||
|
@@ -35,12 +35,12 @@ impl Requester {
|
||||
pub fn init(&self) {
|
||||
let (reply, response) = oneshot();
|
||||
self.tx.send(WorkerTask::Init(reply)).unwrap();
|
||||
return response.recv();
|
||||
response.recv()
|
||||
}
|
||||
|
||||
pub fn login(&self, style: LoginStyle) -> anyhow::Result<()> {
|
||||
let (reply, response) = oneshot();
|
||||
self.tx.send(WorkerTask::Login(style, reply)).unwrap();
|
||||
return response.recv();
|
||||
response.recv()
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ pub(super) fn oneshot<T>() -> (ClientReply<T>, ClientResponse<T>) {
|
||||
let reply = ClientReply(tx);
|
||||
let response = ClientResponse(rx);
|
||||
|
||||
return (reply, response);
|
||||
(reply, response)
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
Reference in New Issue
Block a user