]> git.lizzy.rs Git - rust.git/commitdiff
Consistent variable name alloc for raw_vec
authorIvan Tham <pickfire@riseup.net>
Tue, 4 Aug 2020 15:46:14 +0000 (23:46 +0800)
committerGitHub <noreply@github.com>
Tue, 4 Aug 2020 15:46:14 +0000 (23:46 +0800)
library/alloc/src/raw_vec.rs

index 99ac027bf0b9f9439f9bbedc50f9b8a3312009e4..f403035ec406e027637174cdd1e861175914b1e4 100644 (file)
@@ -203,13 +203,15 @@ fn allocate_in(capacity: usize, init: AllocInit, mut alloc: A) -> Self {
     ///
     /// # Safety
     ///
-    /// The `ptr` must be allocated (via the given allocator `a`), and with the given `capacity`.
+    /// The `ptr` must be allocated (via the given allocator `alloc`), and with the given
+    /// `capacity`.
     /// The `capacity` cannot exceed `isize::MAX` for sized types. (only a concern on 32-bit
     /// systems). ZST vectors may have a capacity up to `usize::MAX`.
-    /// If the `ptr` and `capacity` come from a `RawVec` created via `a`, then this is guaranteed.
+    /// If the `ptr` and `capacity` come from a `RawVec` created via `alloc`, then this is
+    /// guaranteed.
     #[inline]
-    pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, a: A) -> Self {
-        Self { ptr: unsafe { Unique::new_unchecked(ptr) }, cap: capacity, alloc: a }
+    pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, alloc: A) -> Self {
+        Self { ptr: unsafe { Unique::new_unchecked(ptr) }, cap: capacity, alloc }
     }
 
     /// Gets a raw pointer to the start of the allocation. Note that this is