Skip to content

Commit a502601

Browse files
uklotzdeSerial-ATA
authored andcommitted
Reformat code
1 parent 2734d7e commit a502601

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+213
-189
lines changed

benches/create_tag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ bench_tag_write!([
6767
);
6868
}),
6969
(id3v2, Id3v2Tag, |tag| {
70-
use lofty::id3::v2::{Frame, TextInformationFrame};
7170
use lofty::TextEncoding;
71+
use lofty::id3::v2::{Frame, TextInformationFrame};
7272

7373
let picture = Picture::new_unchecked(
7474
PictureType::CoverFront,

lofty/src/aac/read.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use super::header::{ADTSHeader, HEADER_MASK};
21
use super::AacFile;
2+
use super::header::{ADTSHeader, HEADER_MASK};
33
use crate::config::{ParseOptions, ParsingMode};
44
use crate::error::Result;
55
use crate::id3::v2::header::Id3v2Header;
66
use crate::id3::v2::read::parse_id3v2;
7-
use crate::id3::{find_id3v1, ID3FindResults};
7+
use crate::id3::{ID3FindResults, find_id3v1};
88
use crate::macros::{decode_err, err, parse_mode_choice};
9-
use crate::mpeg::header::{cmp_header, search_for_frame_sync, HeaderCmpResult};
9+
use crate::mpeg::header::{HeaderCmpResult, cmp_header, search_for_frame_sync};
1010

1111
use std::io::{Read, Seek, SeekFrom};
1212

@@ -180,7 +180,7 @@ where
180180
return Ok(Some((
181181
first_header,
182182
first_adts_frame_start_absolute + u64::from(header_len),
183-
)))
183+
)));
184184
},
185185
HeaderCmpResult::Undetermined => return Ok(None),
186186
HeaderCmpResult::NotEqual => {},

lofty/src/ape/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use lofty_attr::LoftyFile;
2020

2121
pub use crate::picture::APE_PICTURE_TYPES;
2222
pub use properties::ApeProperties;
23-
pub use tag::item::ApeItem;
2423
pub use tag::ApeTag;
24+
pub use tag::item::ApeItem;
2525

2626
/// An APE file
2727
#[derive(LoftyFile)]

lofty/src/ape/read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::error::Result;
77
use crate::id3::v1::tag::Id3v1Tag;
88
use crate::id3::v2::read::parse_id3v2;
99
use crate::id3::v2::tag::Id3v2Tag;
10-
use crate::id3::{find_id3v1, find_id3v2, find_lyrics3v2, FindId3v2Config, ID3FindResults};
10+
use crate::id3::{FindId3v2Config, ID3FindResults, find_id3v1, find_id3v2, find_lyrics3v2};
1111
use crate::macros::{decode_err, err};
1212

1313
use std::io::{Read, Seek, SeekFrom};

lofty/src/ape/tag/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ mod write;
55
use crate::ape::tag::item::{ApeItem, ApeItemRef};
66
use crate::config::WriteOptions;
77
use crate::error::{LoftyError, Result};
8-
use crate::id3::v2::util::pairs::{format_number_pair, set_number, NUMBER_PAIR_KEYS};
8+
use crate::id3::v2::util::pairs::{NUMBER_PAIR_KEYS, format_number_pair, set_number};
99
use crate::tag::item::ItemValueRef;
1010
use crate::tag::{
11-
try_parse_year, Accessor, ItemKey, ItemValue, MergeTag, SplitTag, Tag, TagExt, TagItem, TagType,
11+
Accessor, ItemKey, ItemValue, MergeTag, SplitTag, Tag, TagExt, TagItem, TagType, try_parse_year,
1212
};
1313
use crate::util::flag_item;
1414
use crate::util::io::{FileLike, Truncate};

lofty/src/ape/tag/read.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use super::item::ApeItem;
21
use super::ApeTag;
2+
use super::item::ApeItem;
3+
use crate::ape::APE_PICTURE_TYPES;
34
use crate::ape::constants::{APE_PREAMBLE, INVALID_KEYS};
45
use crate::ape::header::{self, ApeHeader};
5-
use crate::ape::APE_PICTURE_TYPES;
66
use crate::config::ParseOptions;
77
use crate::error::Result;
88
use crate::macros::{decode_err, err, try_vec};

lofty/src/ape/tag/write.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use super::item::ApeItemRef;
21
use super::ApeTagRef;
2+
use super::item::ApeItemRef;
33
use crate::ape::constants::APE_PREAMBLE;
44
use crate::ape::tag::read;
55
use crate::config::{ParseOptions, WriteOptions};
66
use crate::error::{LoftyError, Result};
7-
use crate::id3::{find_id3v1, find_id3v2, find_lyrics3v2, FindId3v2Config};
7+
use crate::id3::{FindId3v2Config, find_id3v1, find_id3v2, find_lyrics3v2};
88
use crate::macros::{decode_err, err};
99
use crate::probe::Probe;
1010
use crate::tag::item::ItemValueRef;
@@ -134,7 +134,7 @@ where
134134

135135
// Now, if there was a tag at the beginning, remove it
136136
if header_ape_tag.0 {
137-
file_bytes.drain(header_ape_tag.1 .0 as usize..header_ape_tag.1 .1 as usize);
137+
file_bytes.drain(header_ape_tag.1.0 as usize..header_ape_tag.1.1 as usize);
138138
}
139139

140140
file.rewind()?;

lofty/src/config/global_options.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) unsafe fn global_options() -> &'static GlobalOptions {
1313
/// # Examples
1414
///
1515
/// ```rust
16-
/// use lofty::config::{apply_global_options, GlobalOptions};
16+
/// use lofty::config::{GlobalOptions, apply_global_options};
1717
///
1818
/// // I have a custom resolver that I need checked
1919
/// let global_options = GlobalOptions::new().use_custom_resolvers(true);
@@ -58,7 +58,7 @@ impl GlobalOptions {
5858
/// # Examples
5959
///
6060
/// ```rust
61-
/// use lofty::config::{apply_global_options, GlobalOptions};
61+
/// use lofty::config::{GlobalOptions, apply_global_options};
6262
///
6363
/// // By default, `use_custom_resolvers` is enabled. Here, we don't want to use them.
6464
/// let global_options = GlobalOptions::new().use_custom_resolvers(false);
@@ -77,7 +77,7 @@ impl GlobalOptions {
7777
/// # Examples
7878
///
7979
/// ```rust
80-
/// use lofty::config::{apply_global_options, GlobalOptions};
80+
/// use lofty::config::{GlobalOptions, apply_global_options};
8181
///
8282
/// // I have files with gigantic images, I'll double the allocation limit!
8383
/// let global_options = GlobalOptions::new().allocation_limit(32 * 1024 * 1024);
@@ -100,7 +100,7 @@ impl GlobalOptions {
100100
/// # Examples
101101
///
102102
/// ```rust
103-
/// use lofty::config::{apply_global_options, GlobalOptions};
103+
/// use lofty::config::{GlobalOptions, apply_global_options};
104104
///
105105
/// // I'm just reading tags, I don't need to preserve format-specific items
106106
/// let global_options = GlobalOptions::new().preserve_format_specific_items(false);
@@ -136,7 +136,7 @@ impl Default for GlobalOptions {
136136
/// # Examples
137137
///
138138
/// ```rust
139-
/// use lofty::config::{apply_global_options, GlobalOptions};
139+
/// use lofty::config::{GlobalOptions, apply_global_options};
140140
///
141141
/// // I have a custom resolver that I need checked
142142
/// let global_options = GlobalOptions::new().use_custom_resolvers(true);

lofty/src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod global_options;
44
mod parse_options;
55
mod write_options;
66

7-
pub use global_options::{apply_global_options, GlobalOptions};
7+
pub use global_options::{GlobalOptions, apply_global_options};
88
pub use parse_options::{ParseOptions, ParsingMode};
99
pub use write_options::WriteOptions;
1010

lofty/src/flac/read.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
use super::FlacFile;
12
use super::block::Block;
23
use super::properties::FlacProperties;
3-
use super::FlacFile;
44
use crate::config::{ParseOptions, ParsingMode};
55
use crate::error::Result;
66
use crate::flac::block::{BLOCK_ID_PICTURE, BLOCK_ID_STREAMINFO, BLOCK_ID_VORBIS_COMMENTS};
77
use crate::id3::v2::read::parse_id3v2;
8-
use crate::id3::{find_id3v2, FindId3v2Config, ID3FindResults};
8+
use crate::id3::{FindId3v2Config, ID3FindResults, find_id3v2};
99
use crate::macros::{decode_err, err};
1010
use crate::ogg::read::read_comments;
1111
use crate::picture::Picture;

0 commit comments

Comments
 (0)