Remove the deprecated tag module.

This commit is contained in:
KAMADA Ken'ichi 2019-03-31 23:50:04 +09:00
parent f9c4ff475b
commit 56106534cd
6 changed files with 20 additions and 41 deletions

View File

@ -46,19 +46,15 @@
//!
//! # Compatibility
//!
//! Major changes between 0.2.3 and 0.3 are listed below.
//! Major changes between 0.3.1 and 0.4 are listed below.
//!
//! * Enum Error has two new variants: TooBig and NotSupported.
//! * Value::Undefined has the 2nd member to keep the offset of the value.
//! * Struct DateTime has two new fields: nanosecond and offset.
//! * The tag constants have been changed to associated constants of
//! struct `Tag`. Use `Tag::TagName` instead of `tag::TagName`.
//! * The constants in tag module (`tag::TagName`) have been removed.
//! Use `Tag::TagName` instead.
pub use error::Error;
pub use jpeg::get_exif_attr as get_exif_attr_from_jpeg;
pub use reader::Reader;
pub use tag_priv::{Context, Tag};
pub use tag_priv::constants as tag;
pub use tag::{Context, Tag};
pub use tiff::{DateTime, Field};
pub use tiff::parse_exif;
pub use value::Value;
@ -77,8 +73,7 @@ mod endian;
mod error;
mod jpeg;
mod reader;
#[path = "tag.rs"]
mod tag_priv;
mod tag;
mod tiff;
mod util;
mod value;

View File

@ -31,7 +31,7 @@ use std::mem;
use error::Error;
use jpeg;
use tag_priv::Tag;
use tag::Tag;
use tiff;
use tiff::Field;

View File

@ -124,30 +124,16 @@ macro_rules! generate_well_known_tag_constants {
($name:ident, $num:expr, $defval:expr, $dispval:ident, $desc:expr)
),+, )+
) => (
/// A module that contains Exif tag constants.
///
/// Compatibility warning: Exif tag constants in this module will be
/// converted to associated constants of `Tag` when the feature is
/// stabilized.
///
/// It is not recommended to import the constants directly into
/// your namespace; import the module and use with the module name
/// like `tag::DateTime`. The constant names follow the Exif
/// specification but not the Rust naming conventions, and a user
/// of the constants will get the non_upper_case_globals warning
/// if a bare constant is used in a match arm.
// This is discussed in
// <https://github.com/rust-lang/rust/issues/25207>.
pub mod constants {
use super::{Context, Tag};
$($(
$( #[$attr] )*
#[allow(non_upper_case_globals)]
#[deprecated(since = "0.3.0", note = "use `Tag::TagName` instead of `tag::TagName`")]
pub const $name: Tag = Tag($ctx, $num);
)+)+
}
// This is not relevant for associated constants, because
// they cannot be imported even with "uniform paths".
// /// It is not recommended to import the constants directly into
// /// your namespace; import the module and use with the module name
// /// like `tag::DateTime`. The constant names follow the Exif
// /// specification but not the Rust naming conventions, and a user
// /// of the constants will get the non_upper_case_globals warning
// /// if a bare constant is used in a match arm.
// // This is discussed in
// // <https://github.com/rust-lang/rust/issues/25207>.
impl Tag {
$($(
$( #[$attr] )*
@ -156,8 +142,6 @@ macro_rules! generate_well_known_tag_constants {
)+)+
}
// Use a separate module to avoid name conflicts between
// const Tag and static TagInfo.
mod tag_info {
use std::fmt;
use value::Value;

View File

@ -28,7 +28,7 @@ use std::fmt;
use endian::{Endian, BigEndian, LittleEndian};
use error::Error;
use tag_priv::{Context, Tag};
use tag::{Context, Tag};
use value::Value;
use value::get_type_info;
use util::{atou16, ctou32};

View File

@ -89,8 +89,8 @@ impl<'a> Value<'a> {
/// "pixels per inch");
/// ```
#[inline]
pub fn display_as(&self, tag: ::tag_priv::Tag) -> Display {
::tag_priv::display_value_as(self, tag)
pub fn display_as(&self, tag: ::tag::Tag) -> Display {
::tag::display_value_as(self, tag)
}
/// Returns the unsigned integer at the given position.

View File

@ -29,7 +29,7 @@ use std::io::{Seek, SeekFrom, Write};
use endian::{Endian, BigEndian, LittleEndian};
use error::Error;
use tag_priv::{Context, Tag};
use tag::{Context, Tag};
use tiff::{Field, TIFF_BE_SIG, TIFF_LE_SIG};
use value::Value;