public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH pathpatterns 0/2] remove unsafe std::mem::transmute
@ 2023-09-18 13:41 Gabriel Goller
  2023-09-18 13:41 ` [pbs-devel] [PATCH pathpatterns 1/2] match_list: " Gabriel Goller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gabriel Goller @ 2023-09-18 13:41 UTC (permalink / raw)
  To: pbs-devel

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-19  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18 13:41 [pbs-devel] [PATCH pathpatterns 0/2] remove unsafe std::mem::transmute Gabriel Goller
2023-09-18 13:41 ` [pbs-devel] [PATCH pathpatterns 1/2] match_list: " Gabriel Goller
2023-09-18 13:41 ` [pbs-devel] [PATCH proxmox-backup 2/2] datastore: catalog: added lifetime to find function Gabriel Goller
2023-10-11 11:07   ` Gabriel Goller
2023-10-19  9:16 ` [pbs-devel] applied: [PATCH pathpatterns 0/2] remove unsafe std::mem::transmute Wolfgang Bumiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal