diff options
| author | Miguel Ojeda <ojeda@kernel.org> | 2021-02-24 05:48:44 +0100 |
|---|---|---|
| committer | Miguel Ojeda <ojeda@kernel.org> | 2021-02-24 06:13:42 +0100 |
| commit | eefec8abda7cb8e8693aa876fbd1e21f2a6a5c2d (patch) | |
| tree | 967ee057ebe74460adc39e7853d4ed4a9e23c47e /library/alloc/src/collections | |
| parent | fe1bf8e05c39bdcc73fc09e246b7209444e389bc (diff) | |
| download | rust-eefec8abda7cb8e8693aa876fbd1e21f2a6a5c2d.tar.gz rust-eefec8abda7cb8e8693aa876fbd1e21f2a6a5c2d.zip | |
library: Normalize safety-for-unsafe-block comments
Almost all safety comments are of the form `// SAFETY:`, so normalize the rest and fix a few of them that should have been a `/// # Safety` section instead. Furthermore, make `tidy` only allow the uppercase form. While currently `tidy` only checks `core`, it is a good idea to prevent `core` from drifting to non-uppercase comments, so that later we can start checking `alloc` etc. too. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'library/alloc/src/collections')
| -rw-r--r-- | library/alloc/src/collections/btree/map/entry.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/collections/btree/map/entry.rs b/library/alloc/src/collections/btree/map/entry.rs index 6cc8813bc52..941f82a8070 100644 --- a/library/alloc/src/collections/btree/map/entry.rs +++ b/library/alloc/src/collections/btree/map/entry.rs @@ -278,14 +278,14 @@ impl<'a, K: Ord, V> VacantEntry<'a, K, V> { pub fn insert(self, value: V) -> &'a mut V { let out_ptr = match self.handle.insert_recursing(self.key, value) { (Fit(_), val_ptr) => { - // Safety: We have consumed self.handle and the handle returned. + // SAFETY: We have consumed self.handle and the handle returned. let map = unsafe { self.dormant_map.awaken() }; map.length += 1; val_ptr } (Split(ins), val_ptr) => { drop(ins.left); - // Safety: We have consumed self.handle and the reference returned. + // SAFETY: We have consumed self.handle and the reference returned. let map = unsafe { self.dormant_map.awaken() }; let root = map.root.as_mut().unwrap(); root.push_internal_level().push(ins.kv.0, ins.kv.1, ins.right); |
