Add extra commentabout unsafe usage

This commit is contained in:
Brendan Hansknecht 2021-09-03 11:00:27 -07:00
parent d9d0d0c0af
commit ad974dd473

View file

@ -261,6 +261,7 @@ where
let layout_map = self.layout_map(); let layout_map = self.layout_map();
for arg in *arguments { for arg in *arguments {
if let Some(layout) = layout_map.get(arg) { if let Some(layout) = layout_map.get(arg) {
// This is safe because every value in the map is always set with a valid layout and cannot be null.
arg_layouts.push(unsafe { *(*layout) }); arg_layouts.push(unsafe { *(*layout) });
} else { } else {
return Err(format!("the argument, {:?}, has no know layout", arg)); return Err(format!("the argument, {:?}, has no know layout", arg));