[pbs-devel] [PATCH pathpatterns 0/2] remove unsafe std::mem::transmute

Gabriel Goller g.goller at proxmox.com
Mon Sep 18 15:41:07 CEST 2023


In the `MatchList` trait we have a function `matches`, which uses the
unsafe `std::mem::transmute` function to 'force-cast' to a different
type [0]. We can avoid this by adding a lifetime to the `MatchList`
trait and the `&self` parameter. This only requires a single change 
in `proxmox-backup` to work.

[0]: https://doc.rust-lang.org/nomicon/transmutes.html


pathpatterns: 

Gabriel Goller (1):
  match_list: remove unsafe std::mem::transmute

 src/match_list.rs | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)


proxmox-backup:

Gabriel Goller (1):
  datastore: catalog: added lifetime to find function

 pbs-datastore/src/catalog.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.39.2






More information about the pbs-devel mailing list