Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

52
vendor/bindgen/options/as_args.rs vendored Normal file
View File

@@ -0,0 +1,52 @@
use std::path::PathBuf;
use crate::regex_set::RegexSet;
/// Trait used to turn [`crate::BindgenOptions`] fields into CLI args.
pub(super) trait AsArgs {
fn as_args(&self, args: &mut Vec<String>, flag: &str);
}
/// If the `bool` is `true`, `flag` is pushed into `args`.
///
/// be careful about the truth value of the field as some options, like `--no-layout-tests`, are
/// actually negations of the fields.
impl AsArgs for bool {
fn as_args(&self, args: &mut Vec<String>, flag: &str) {
if *self {
args.push(flag.to_string());
}
}
}
/// Iterate over all the items of the `RegexSet` and push `flag` followed by the item into `args`
/// for each item.
impl AsArgs for RegexSet {
fn as_args(&self, args: &mut Vec<String>, flag: &str) {
for item in self.get_items() {
args.extend_from_slice(&[flag.to_owned(), item.clone().into()]);
}
}
}
/// If the `Option` is `Some(value)`, push `flag` followed by `value`.
impl AsArgs for Option<String> {
fn as_args(&self, args: &mut Vec<String>, flag: &str) {
if let Some(string) = self {
args.extend_from_slice(&[flag.to_owned(), string.clone()]);
}
}
}
/// If the `Option` is `Some(path)`, push `flag` followed by the [`std::path::Path::display`]
/// representation of `path`.
impl AsArgs for Option<PathBuf> {
fn as_args(&self, args: &mut Vec<String>, flag: &str) {
if let Some(path) = self {
args.extend_from_slice(&[
flag.to_owned(),
path.display().to_string(),
]);
}
}
}

1151
vendor/bindgen/options/cli.rs vendored Normal file

File diff suppressed because it is too large Load Diff

43
vendor/bindgen/options/helpers.rs vendored Normal file
View File

@@ -0,0 +1,43 @@
/// Helper function that appends extra documentation to [`crate::Builder`] methods that support regular
/// expressions in their input.
macro_rules! regex_option {
($(#[$attrs:meta])* pub fn $($tokens:tt)*) => {
$(#[$attrs])*
///
/// Regular expressions are supported. Check the [regular expression
/// arguments](./struct.Builder.html#regular-expression-arguments) section and the
/// [regex](https://docs.rs/regex) crate documentation for further information.
pub fn $($tokens)*
};
}
/// Helper macro to set the default value of each option.
///
/// This macro is an internal implementation detail of the `options` macro and should not be used
/// directly.
macro_rules! default {
() => {
Default::default()
};
($expr:expr) => {
$expr
};
}
/// Helper macro to set the conversion to CLI arguments for each option.
///
/// This macro is an internal implementation detail of the `options` macro and should not be used
/// directly.
macro_rules! as_args {
($flag:literal) => {
|field, args| AsArgs::as_args(field, args, $flag)
};
($expr:expr) => {
$expr
};
}
/// Helper function to ignore an option when converting it into CLI arguments.
///
/// This function is only used inside `options` and should not be used in other contexts.
pub(super) fn ignore<T>(_: &T, _: &mut Vec<String>) {}

2286
vendor/bindgen/options/mod.rs vendored Normal file

File diff suppressed because it is too large Load Diff