Fix some grammar errors and hyperlinks in doc for trait Allocator

* "while until either" could also be changed to "for a while until either", but I just deleted "while".
* fixed sentence with incorrect "at" and "has/have".
* linked [*currently allocated*] similar to other methods.
This commit is contained in:
Janggun Lee 2025-04-14 22:26:43 +09:00 committed by GitHub
parent 5961e5ba3d
commit 0369ccb532
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,7 +90,7 @@ impl fmt::Display for AllocError {
/// # Safety
///
/// Memory blocks that are [*currently allocated*] by an allocator,
/// must point to valid memory, and retain their validity while until either:
/// must point to valid memory, and retain their validity until either:
/// - the memory block is deallocated, or
/// - the allocator is dropped.
///
@ -112,7 +112,9 @@ pub unsafe trait Allocator {
///
/// The returned block of memory remains valid as long as it is [*currently allocated*] and the shorter of:
/// - the borrow-checker lifetime of the allocator type itself.
/// - as long as at the allocator and all its clones has not been dropped.
/// - as long as the allocator and all its clones have not been dropped.
///
/// [*currently allocated*]: #currently-allocated-memory
///
/// # Errors
///