Make documentation adhere clippy, more natural
This commit is contained in:
1 parent
f6a762b72c
commit
46e51cc67e
2 files changed
+29
-23
No files matched your search
+11
-13
@@ -135,20 +135,17 @@ impl<R: Read> EndianReader<R> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
//
|
||||||
/// # READERS
|
// # READERS
|
||||||
///
|
//
|
||||||
|
|
||||||
///
|
|
||||||
/// ## Deflate Reader
|
|
||||||
///
|
|
||||||
|
|
||||||
|
/// Type alias for the deflate Reader
|
||||||
#[cfg(feature = "deflate")]
|
#[cfg(feature = "deflate")]
|
||||||
pub type DeflateReader<R> = flate2::read::ZlibDecoder<R>;
|
pub type DeflateReader<R> = flate2::read::ZlibDecoder<R>;
|
||||||
|
|
||||||
///
|
//
|
||||||
/// ## LZW Reader
|
// ## LZW Reader
|
||||||
///
|
//
|
||||||
|
|
||||||
/// Reader that decompresses LZW streams
|
/// Reader that decompresses LZW streams
|
||||||
#[cfg(feature = "lzw")]
|
#[cfg(feature = "lzw")]
|
||||||
@@ -207,10 +204,11 @@ impl<R: Read> Read for LZWReader<R> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
//
|
||||||
/// ## PackBits Reader
|
// ## PackBits Reader
|
||||||
///
|
//
|
||||||
|
|
||||||
|
/// Internal state machine for the PackBitsReader.
|
||||||
enum PackBitsReaderState {
|
enum PackBitsReaderState {
|
||||||
Header,
|
Header,
|
||||||
Literal,
|
Literal,
|
||||||
|
|||||||
+18
-10
@@ -2,7 +2,7 @@ macro_rules! tags {
|
|||||||
{
|
{
|
||||||
// Permit arbitrary meta items, which include documentation.
|
// Permit arbitrary meta items, which include documentation.
|
||||||
$( #[$enum_attr:meta] )*
|
$( #[$enum_attr:meta] )*
|
||||||
$vis:vis enum $name:ident($ty:tt) $(unknown($unknown_doc:literal))* {
|
$vis:vis enum $name:ident($ty:tt) $(unknown(#[$unknown_meta:meta] $unknown_doc:ident))* {
|
||||||
// Each of the `Name = Val,` permitting documentation.
|
// Each of the `Name = Val,` permitting documentation.
|
||||||
$($(#[$ident_attr:meta])* $tag:ident = $val:expr,)*
|
$($(#[$ident_attr:meta])* $tag:ident = $val:expr,)*
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@ macro_rules! tags {
|
|||||||
pub enum $name {
|
pub enum $name {
|
||||||
$($(#[$ident_attr])* $tag,)*
|
$($(#[$ident_attr])* $tag,)*
|
||||||
$(
|
$(
|
||||||
#[doc = $unknown_doc]
|
#[$unknown_meta]
|
||||||
Unknown($ty),
|
Unknown($ty),
|
||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ macro_rules! tags {
|
|||||||
fn __to_inner_type(&self) -> $ty {
|
fn __to_inner_type(&self) -> $ty {
|
||||||
match *self {
|
match *self {
|
||||||
$( $name::$tag => $val, )*
|
$( $name::$tag => $val, )*
|
||||||
$( $name::Unknown(n) => { $unknown_doc; n }, )*
|
$( $name::Unknown($unknown_doc) => { $unknown_doc }, )*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ macro_rules! tags {
|
|||||||
tags!($name, $ty, $($unknown_doc)*);
|
tags!($name, $ty, $($unknown_doc)*);
|
||||||
};
|
};
|
||||||
// For u16 tags, provide direct inherent primitive conversion methods.
|
// For u16 tags, provide direct inherent primitive conversion methods.
|
||||||
($name:tt, u16, $($unknown_doc:literal)*) => {
|
($name:tt, u16, $($unknown_doc:ident)*) => {
|
||||||
impl $name {
|
impl $name {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn from_u16(val: u16) -> Option<Self> {
|
pub fn from_u16(val: u16) -> Option<Self> {
|
||||||
@@ -48,9 +48,8 @@ macro_rules! tags {
|
|||||||
|
|
||||||
$(
|
$(
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn from_u16_exhaustive(val: u16) -> Self {
|
pub fn from_u16_exhaustive($unknown_doc: u16) -> Self {
|
||||||
$unknown_doc;
|
Self::__from_inner_type($unknown_doc).unwrap_or_else(|_| $name::Unknown($unknown_doc))
|
||||||
Self::__from_inner_type(val).unwrap_or_else(|_| $name::Unknown(val))
|
|
||||||
}
|
}
|
||||||
)*
|
)*
|
||||||
|
|
||||||
@@ -68,7 +67,10 @@ macro_rules! tags {
|
|||||||
// Note: These tags appear in the order they are mentioned in the TIFF reference
|
// Note: These tags appear in the order they are mentioned in the TIFF reference
|
||||||
tags! {
|
tags! {
|
||||||
/// TIFF tags
|
/// TIFF tags
|
||||||
pub enum Tag(u16) unknown("A private or extension tag") {
|
pub enum Tag(u16) unknown(
|
||||||
|
/// A private or extension tag
|
||||||
|
unknown
|
||||||
|
) {
|
||||||
// Baseline tags:
|
// Baseline tags:
|
||||||
Artist = 315,
|
Artist = 315,
|
||||||
// grayscale images PhotometricInterpretation 1 or 3
|
// grayscale images PhotometricInterpretation 1 or 3
|
||||||
@@ -192,7 +194,10 @@ pub enum Type(u16) {
|
|||||||
tags! {
|
tags! {
|
||||||
/// See [TIFF compression tags](https://www.awaresystems.be/imaging/tiff/tifftags/compression.html)
|
/// See [TIFF compression tags](https://www.awaresystems.be/imaging/tiff/tifftags/compression.html)
|
||||||
/// for reference.
|
/// for reference.
|
||||||
pub enum CompressionMethod(u16) unknown("A custom compression method") {
|
pub enum CompressionMethod(u16) unknown(
|
||||||
|
/// A custom compression method
|
||||||
|
unknown
|
||||||
|
) {
|
||||||
None = 1,
|
None = 1,
|
||||||
Huffman = 2,
|
Huffman = 2,
|
||||||
Fax3 = 3,
|
Fax3 = 3,
|
||||||
@@ -254,7 +259,10 @@ pub enum ResolutionUnit(u16) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tags! {
|
tags! {
|
||||||
pub enum SampleFormat(u16) unknown("An unknown extension sample format") {
|
pub enum SampleFormat(u16) unknown(
|
||||||
|
/// An unknown extension sample format
|
||||||
|
unknown
|
||||||
|
) {
|
||||||
Uint = 1,
|
Uint = 1,
|
||||||
Int = 2,
|
Int = 2,
|
||||||
IEEEFP = 3,
|
IEEEFP = 3,
|
||||||
|
|||||||
Reference in new issue
Block a user