Skip to content

Commit

Permalink
Aggregate imports (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldm0 authored Jan 8, 2024
1 parent dc1891b commit 9dec789
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imports_granularity = "Crate"
3 changes: 1 addition & 2 deletions src/avutil/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ impl<'frame> AVFrameSideDataRef<'frame> {
#[cfg(test)]
mod test {
use super::*;
use crate::avcodec::AVCodec;
use crate::avutil::AVChannelLayout;
use crate::{avcodec::AVCodec, avutil::AVChannelLayout};

#[test]
fn test_get_buffer() {
Expand Down
12 changes: 6 additions & 6 deletions src/avutil/opt.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::error::Result;
use crate::ffi;
use crate::ffi::AVPixelFormat;
use crate::ffi::AVRational;
use crate::ffi::AVSampleFormat;
use crate::shared::RetUpgrade;
use crate::{
error::Result,
ffi,
ffi::{AVPixelFormat, AVRational, AVSampleFormat},
shared::RetUpgrade,
};
use std::ffi::{c_double, c_int, c_void, CStr};

/// - `name`: the name of the field to set
Expand Down
7 changes: 2 additions & 5 deletions src/avutil/pixdesc.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use crate::ffi;
use crate::shared::PointerUpgrade;
use crate::{ffi, shared::PointerUpgrade};

use std::ffi::CStr;
use std::ops::Deref;
use std::ptr::NonNull;
use std::{ffi::CStr, ops::Deref, ptr::NonNull};

pub use ffi::AVComponentDescriptor;

Expand Down
4 changes: 1 addition & 3 deletions src/avutil/timestamp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::ffi::av_q2d;
use crate::ffi::AVRational;
use crate::ffi::AV_NOPTS_VALUE;
use crate::ffi::{av_q2d, AVRational, AV_NOPTS_VALUE};
use std::ffi::c_double;

/// Get a string containing a timestamp representation.
Expand Down
12 changes: 7 additions & 5 deletions tests/decode_audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ use rsmpeg::{
ffi,
};
use rusty_ffmpeg::ffi::AV_INPUT_BUFFER_PADDING_SIZE;
use std::fs::{self, File};
use std::io::Write;
use std::path::Path;
use std::slice::from_raw_parts;
use std::{ffi::CString, io::Read};
use std::{
ffi::CString,
fs::{self, File},
io::{Read, Write},
path::Path,
slice::from_raw_parts,
};

fn get_format_from_sample_fmt(sample_fmt: AVSampleFormat) -> Option<&'static str> {
let sample_fmt_entries = [
Expand Down
10 changes: 6 additions & 4 deletions tests/remux.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//! RIIR: https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/remux.c
use anyhow::{Context, Result};
use cstr::cstr;
use rsmpeg::avcodec::AVPacket;
use rsmpeg::avformat::{AVFormatContextInput, AVFormatContextOutput};
use rsmpeg::avutil::{ts2str, ts2timestr};
use rsmpeg::ffi::AVRational;
use rsmpeg::{
avcodec::AVPacket,
avformat::{AVFormatContextInput, AVFormatContextOutput},
avutil::{ts2str, ts2timestr},
ffi::AVRational,
};
use std::ffi::CStr;

fn log_packet(time_base: AVRational, pkt: &AVPacket, tag: &str) {
Expand Down

0 comments on commit 9dec789

Please sign in to comment.