removed unnecessary strings

This commit is contained in:
Emma Tebibyte 2024-04-24 20:18:56 -06:00
parent 112e052f18
commit c1a9df3166
Signed by: emma
GPG Key ID: 06FA419A1698C270
2 changed files with 25 additions and 7 deletions

View File

@ -28,19 +28,16 @@
*/
use std::{
io::{ self, Write },
io::{ Error, Write },
process::{ Command, exit, Stdio },
path::PathBuf,
};
use bindgen::{ Builder, CargoCallbacks, MacroTypeVariation };
fn main() -> Result<(), io::Error> {
fn main() -> Result<(), Error> {
let mut header = String::new();
/* bindgen has a dependency on clang for now */
Command::new("clang").spawn().expect("Missing dependency: clang");
/* Locate sysexits.h using cpp(1) */
let mut process = Command::new("cpp")
.arg("-M")
@ -54,8 +51,8 @@ fn main() -> Result<(), io::Error> {
let output = process.wait_with_output()?.stdout;
let headers = String::from_utf8(output).unwrap_or_else( |_| {
eprintln!("Output from cpp(1) is invalid UTF-8.");
let headers = String::from_utf8(output).unwrap_or_else( |e| {
Error::other(e.to_string());
/* Exit with status 1 because were bootstrapping sysexits.h, silly! */
exit(1);
});

View File

@ -0,0 +1,21 @@
/* automatically generated by rust-bindgen 0.69.4 */
pub const _SYSEXITS_H: i32 = 1;
pub const EX_OK: i32 = 0;
pub const EX__BASE: i32 = 64;
pub const EX_USAGE: i32 = 64;
pub const EX_DATAERR: i32 = 65;
pub const EX_NOINPUT: i32 = 66;
pub const EX_NOUSER: i32 = 67;
pub const EX_NOHOST: i32 = 68;
pub const EX_UNAVAILABLE: i32 = 69;
pub const EX_SOFTWARE: i32 = 70;
pub const EX_OSERR: i32 = 71;
pub const EX_OSFILE: i32 = 72;
pub const EX_CANTCREAT: i32 = 73;
pub const EX_IOERR: i32 = 74;
pub const EX_TEMPFAIL: i32 = 75;
pub const EX_PROTOCOL: i32 = 76;
pub const EX_NOPERM: i32 = 77;
pub const EX_CONFIG: i32 = 78;
pub const EX__MAX: i32 = 78;