util/dictionary: add a dict! macro to create a dictionary
This commit is contained in:
parent
0eb82bedf4
commit
c66aa6efbb
@ -7,6 +7,7 @@ extern crate ffmpeg_sys as sys;
|
||||
|
||||
pub use sys as ffi;
|
||||
|
||||
#[macro_use]
|
||||
pub mod util;
|
||||
pub use util::error::Error;
|
||||
pub use util::dictionary;
|
||||
|
@ -9,3 +9,17 @@ pub use self::owned::Owned;
|
||||
|
||||
mod iter;
|
||||
pub use self::iter::Iter;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! dict {
|
||||
( $($key:expr => $value:expr),* $(,)*) => ({
|
||||
let mut dict = ::ffmpeg::Dictionary::new();
|
||||
|
||||
$(
|
||||
dict.set($key, $value);
|
||||
)*
|
||||
|
||||
dict
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
#[macro_use]
|
||||
pub mod dictionary;
|
||||
pub mod error;
|
||||
pub mod rational;
|
||||
|
Loading…
x
Reference in New Issue
Block a user