Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename new_with_max_reads
  • Loading branch information
Darksonn committed Apr 12, 2021
commit b3231ecd68900a26c5068480fb0bb39c5fb7e35d
8 changes: 4 additions & 4 deletions tokio/src/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ impl<T: ?Sized> RwLock<T> {
/// ```
/// use tokio::sync::RwLock;
///
/// let lock = RwLock::new_with_max_reads(5, 1024);
/// let lock = RwLock::with_max_readers(5, 1024);
/// ```
///
/// # Panics
///
/// Panics if `max_reads` is more than `u32::MAX >> 3`.
pub fn new_with_max_reads(value: T, max_reads: u32) -> RwLock<T>
pub fn with_max_readers(value: T, max_reads: u32) -> RwLock<T>
where
T: Sized,
{
Expand Down Expand Up @@ -268,11 +268,11 @@ impl<T: ?Sized> RwLock<T> {
/// ```
/// use tokio::sync::RwLock;
///
/// static LOCK: RwLock<i32> = RwLock::const_new_with_max_reads(5, 1024);
/// static LOCK: RwLock<i32> = RwLock::const_with_max_readers(5, 1024);
/// ```
#[cfg(all(feature = "parking_lot", not(all(loom, test))))]
#[cfg_attr(docsrs, doc(cfg(feature = "parking_lot")))]
pub const fn const_new_with_max_reads(value: T, mut max_reads: u32) -> RwLock<T>
pub const fn const_with_max_readers(value: T, mut max_reads: u32) -> RwLock<T>
where
T: Sized,
{
Expand Down