linuxmint / timeshift

System restore tool for Linux. Creates filesystem snapshots using rsync+hardlinks, or BTRFS snapshots. Supports scheduled snapshots, multiple backup levels, and exclude filters. Snapshots can be restored while system is running or from Live CD/USB.
2.39k stars 86 forks source link

Use an unsafe cast #200

Closed yegorich closed 1 year ago

yegorich commented 1 year ago

This approach resolves warnings like this:

Access to possible `null'. Perform a check or use an unsafe cast.

yegorich commented 1 year ago

@mtwebster what do you think about this approach? There are also a lot of other cases with the cell object.

The most strange thing is that even the official examples were made so that they produce such warnings :-(

yegorich commented 1 year ago

I've also seen the following solution but I prefer the unsafe one.

mtwebster commented 1 year ago

I'd do what you've got here, if only because it's what I'd ordinarily do in C (vala's pretty frustrating for me)

yegorich commented 1 year ago

Vala is frustrating for me too :-) I'll continue with fixing further occurrences.

yegorich commented 1 year ago

Done