Skip to content

Commit

Permalink
happy clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Aug 1, 2024
1 parent b13dbe9 commit a4a7e5d
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
//! [`policy` module]:
//!
//! * Refine `BufReader`'s behavior by implementing the [`ReaderPolicy` trait] or use
//! an existing implementation like [`MinBuffered`] to ensure the buffer always contains
//! a minimum number of bytes (until the underlying reader is empty).
//! an existing implementation like [`MinBuffered`] to ensure the buffer always contains
//! a minimum number of bytes (until the underlying reader is empty).
//!
//! * Refine `BufWriter`'s behavior by implementing the [`WriterPolicy` trait]
//! or use an existing implementation like [`FlushOn`] to flush when a particular byte
//! appears in the buffer (used to implement [`LineWriter`]).
//! or use an existing implementation like [`FlushOn`] to flush when a particular byte
//! appears in the buffer (used to implement [`LineWriter`]).
//!
//! [`policy` module]: policy
//! [`ReaderPolicy` trait]: policy::ReaderPolicy
Expand Down Expand Up @@ -112,19 +112,19 @@
//! However, this has some caveats:
//!
//! * It is only available on target platforms with virtual memory support, namely fully fledged
//! OSes such as Windows and Unix-derivative platforms like Linux, OS X, BSD variants, etc.
//! OSes such as Windows and Unix-derivative platforms like Linux, OS X, BSD variants, etc.
//!
//! * The default capacity varies based on platform, and custom capacities are rounded up to a
//! multiple of their minimum size, typically the page size of the platform.
//! Windows' minimum size is comparably quite large (**64 KiB**) due to some legacy reasons,
//! so this may be less optimal than the default capacity for a normal buffer (8 KiB) for some
//! use-cases.
//! multiple of their minimum size, typically the page size of the platform.
//! Windows' minimum size is comparably quite large (**64 KiB**) due to some legacy reasons,
//! so this may be less optimal than the default capacity for a normal buffer (8 KiB) for some
//! use-cases.
//!
//! * Due to the nature of the virtual-memory trick, the virtual address space the buffer
//! allocates will be double its capacity. This means that your program will *appear* to use more
//! memory than it would if it was using a normal buffer of the same capacity. The physical memory
//! usage will be the same in both cases, but if address space is at a premium in your application
//! (32-bit targets) then this may be a concern.
//! allocates will be double its capacity. This means that your program will *appear* to use more
//! memory than it would if it was using a normal buffer of the same capacity. The physical memory
//! usage will be the same in both cases, but if address space is at a premium in your application
//! (32-bit targets) then this may be a concern.
//!
//! [ringbuf-wikipedia]: https://en.wikipedia.org/wiki/Circular_buffer#Optimization
#![warn(missing_docs)]
Expand Down Expand Up @@ -907,7 +907,7 @@ impl Buffer {
/// The default capacity varies based on the target platform:
///
/// * Unix-derivative platforms; Linux, OS X, BSDs, etc: **8KiB** (the default buffer size for
/// `std::io` buffered types)
/// `std::io` buffered types)
/// * Windows: **64KiB** because of legacy reasons, of course (see below)
///
/// Only available on platforms with virtual memory support and with the `slice-deque` feature
Expand All @@ -926,10 +926,10 @@ impl Buffer {
/// The capacity will be rounded up to the minimum size for the current target:
///
/// * Unix-derivative platforms; Linux, OS X, BSDs, etc: the next multiple of the page size
/// (typically 4KiB but can vary based on system configuration)
/// (typically 4KiB but can vary based on system configuration)
/// * Windows: the next muliple of **64KiB**; see [this Microsoft dev blog post][Win-why-64k]
/// for why it's 64KiB and not the page size (TL;DR: Alpha AXP needs it and it's applied on
/// all targets for consistency/portability)
/// for why it's 64KiB and not the page size (TL;DR: Alpha AXP needs it and it's applied on
/// all targets for consistency/portability)
///
/// [Win-why-64k]: https://blogs.msdn.microsoft.com/oldnewthing/20031008-00/?p=42223
///
Expand Down Expand Up @@ -1313,9 +1313,9 @@ thread_local!(
///
/// ### Panics
/// If called from within a handler previously provided to this function.
pub fn set_drop_err_handler<F: 'static>(handler: F)
pub fn set_drop_err_handler<F>(handler: F)
where
F: Fn(&mut dyn Write, &mut Buffer, io::Error),
F: 'static + Fn(&mut dyn Write, &mut Buffer, io::Error),
{
DROP_ERR_HANDLER.with(|deh| *deh.borrow_mut() = Box::new(handler))
}

0 comments on commit a4a7e5d

Please sign in to comment.