diff --git a/src/bindgen/builder.rs b/src/bindgen/builder.rs index e2fa95b..3bacfaf 100644 --- a/src/bindgen/builder.rs +++ b/src/bindgen/builder.rs @@ -6,7 +6,7 @@ use std::path; use crate::bindgen::bindings::Bindings; use crate::bindgen::cargo::Cargo; -use crate::bindgen::config::{Braces, Config, Language}; +use crate::bindgen::config::{Braces, Config, Language, Style}; use crate::bindgen::error::Error; use crate::bindgen::library::Library; use crate::bindgen::parser::{self, Parse}; @@ -138,6 +138,12 @@ impl Builder { self } + #[allow(unused)] + pub fn with_style(mut self, style: Style) -> Builder { + self.config.style = style; + self + } + #[allow(unused)] pub fn include_item>(mut self, item_name: S) -> Builder { self.config @@ -342,3 +348,16 @@ impl Builder { .generate() } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn with_style() { + assert_eq!( + Style::Tag, + Builder::new().with_style(Style::Tag).config.style + ); + } +}