properties_view: Ignore result of sending SVG metadata across threads

`parse_svg_file_future()` is called in a cancellable async
block. This means that after it's called it can be cancelled,
which drops the receiver. When we fetch the metadata, we try
sending the result to the dropped receiver.

This is expected behavior in this case - the receiver
being gone at the time of sending the metadata is perfectly
valid. However, previously we would cause the thread to panic.
This didn't break anything but made for scary log message.

Since this is expected behavior we can use `_` to tell the
compiler that we don't care about the outcome of sending.
This is valid in this instance because we will only get an
error if the receiver is gone.
This commit is contained in:
Christopher Davis 2022-08-02 21:15:45 -04:00
parent ba4661031f
commit 386b41e482

View file

@ -381,7 +381,7 @@ async fn parse_svg_file_future(path: std::path::PathBuf) -> anyhow::Result<svg_m
std::thread::spawn(move || { std::thread::spawn(move || {
let result = svg_metadata::Metadata::parse_file(path); let result = svg_metadata::Metadata::parse_file(path);
sender.send(result).unwrap() let _ = sender.send(result);
}); });
receiver.await.unwrap().context("Could not load metadata") receiver.await.unwrap().context("Could not load metadata")