C++: Warn when the return value of slint::Image::load_from_path is not used

Somebody recently accidentally wrote this code:

```cpp
slint::Image image;
image.load_from_path(...);
```

and that should have produced a warning.
This commit is contained in:
Simon Hausmann 2023-05-10 09:20:36 +02:00 committed by Simon Hausmann
parent f5b3e89e08
commit 77645d9908

View file

@ -112,7 +112,7 @@ public:
Image() : data(Data::ImageInner_None()) { }
/// Load an image from an image file
static Image load_from_path(const SharedString &file_path)
[[nodiscard]] static Image load_from_path(const SharedString &file_path)
{
Image img;
cbindgen_private::types::slint_image_load_from_path(&file_path, &img.data);