1
0
Fork 0
forked from wry/wry

all: use let chains

This commit is contained in:
Julian Orth 2025-07-01 11:20:48 +02:00
parent 3d5d146d65
commit 286857971a
89 changed files with 1516 additions and 1574 deletions

View file

@ -107,13 +107,13 @@ where
pub fn run(self) {
let n = self.node;
n.needs_event.set(true);
if n.new_data != n.data {
if let Some(on_unmatch) = n.on_unmatch.take() {
if n.leaf.strong_count() == 0 {
return;
}
on_unmatch();
if n.new_data != n.data
&& let Some(on_unmatch) = n.on_unmatch.take()
{
if n.leaf.strong_count() == 0 {
return;
}
on_unmatch();
}
n.data.set(n.new_data.get());
if n.data.is_some() != n.on_unmatch.is_some() {

View file

@ -79,10 +79,10 @@ where
}
pub fn remove(&self, target_id: Target::Id) {
if let Some(node) = self.data.borrow_mut().remove(&target_id) {
if let Some(node) = node.node.upgrade() {
node.data().destroyed().remove(&self.id);
}
if let Some(node) = self.data.borrow_mut().remove(&target_id)
&& let Some(node) = node.node.upgrade()
{
node.data().destroyed().remove(&self.id);
}
}

View file

@ -45,11 +45,11 @@ impl TlmMatchClient {
}
pub fn handle(&self, node: &ToplevelData) {
if let Some(client) = &node.client {
if self.node.get(client) {
let data = self.downstream.get_or_create(node);
self.downstream.update_matched(node, data, true, false);
}
if let Some(client) = &node.client
&& self.node.get(client)
{
let data = self.downstream.get_or_create(node);
self.downstream.update_matched(node, data, true, false);
}
}
}