Skip to content

Commit ac824ec

Browse files
alloncmemilio
authored andcommitted
Expose the line_endings config option to use with the builder
1 parent 11320ac commit ac824ec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bindgen/builder.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::path;
66

77
use crate::bindgen::bindings::Bindings;
88
use crate::bindgen::cargo::Cargo;
9-
use crate::bindgen::config::{Braces, Config, Language, Profile, Style};
9+
use crate::bindgen::config::{Braces, Config, Language, LineEndingStyle, Profile, Style};
1010
use crate::bindgen::error::Error;
1111
use crate::bindgen::library::Library;
1212
use crate::bindgen::parser::{self, Parse};
@@ -343,6 +343,12 @@ impl Builder {
343343
self
344344
}
345345

346+
#[allow(unused)]
347+
pub fn with_line_endings(mut self, line_ending_style: LineEndingStyle) -> Builder {
348+
self.config.line_endings = line_ending_style;
349+
self
350+
}
351+
346352
pub fn generate(self) -> Result<Bindings, Error> {
347353
// If macro expansion is enabled, then cbindgen will attempt to build the crate
348354
// and will run its build script which may run cbindgen again. That second run may start

0 commit comments

Comments
 (0)