From ac9bac6efd486054039783dacfeba4023eb9d6ac Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 21 Oct 2022 16:51:49 -0700 Subject: [PATCH] docs --- utils/src/pocket.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/src/pocket.rs b/utils/src/pocket.rs index d9ffc2784..d4c6914eb 100644 --- a/utils/src/pocket.rs +++ b/utils/src/pocket.rs @@ -4,15 +4,15 @@ use std::any::TypeId; use std::mem::{forget, size_of, MaybeUninit}; use std::ptr::{drop_in_place, read, write}; -/// A statically sized container that acts a bit like Box. +/// A statically sized container that acts a bit like Box but with less overhead. /// /// This is used in a few places to avoid cascades of templates by allowing templated -/// objects to be held generically and accessed only within templated functions. It does so -/// with very low to zero runtime overhead or memory overhead and panics if misused. +/// objects to be held generically and accessed only within templated functions. There's a +/// bit of unsafe here but externally it's safe and panics if misused. /// /// This will panic if the capacity is too small. If that occurs, it must be enlarged. It will /// also panic if any of the accessors (other than the try_ versions) are used to try to get -/// a type other than the one it was +/// a type other than the one it was constructed with. pub struct Pocket { storage: [u8; CAPACITY], dropper: fn(*mut u8),