From 09d32e45f2c4639e603d65afbd219bd99b06cc27 Mon Sep 17 00:00:00 2001 From: alloncm Date: Tue, 28 Oct 2025 22:44:44 +0200 Subject: [PATCH] Expose the line_endings config option to use with the builder --- src/bindgen/builder.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bindgen/builder.rs b/src/bindgen/builder.rs index a6b6c983..b206ced9 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, Profile, Style}; +use crate::bindgen::config::{Braces, Config, Language, LineEndingStyle, Profile, Style}; use crate::bindgen::error::Error; use crate::bindgen::library::Library; use crate::bindgen::parser::{self, Parse}; @@ -343,6 +343,12 @@ impl Builder { self } + #[allow(unused)] + pub fn with_line_endings(mut self, line_ending_style: LineEndingStyle) -> Builder { + self.config.line_endings = line_ending_style; + self + } + pub fn generate(self) -> Result { // If macro expansion is enabled, then cbindgen will attempt to build the crate // and will run its build script which may run cbindgen again. That second run may start