edge cases in cargo-fmt

so...i think in this case, maybe the build.rs wasn't formatted?
it got picked up the second time when i ran the command.

in the case of pddbkey.rs, I think the changes made by rustfmt
were so dramatic it required two passes for it to become clean.
This commit is contained in:
bunnie 2024-01-15 00:56:24 +08:00
parent e274fa8873
commit b8dc0a981c
2 changed files with 8 additions and 15 deletions

View file

@ -3,19 +3,12 @@ extern crate cc;
use std::env::set_var;
fn main() {
set_var("CC", "riscv64-unknown-elf-gcc"); // set the compiler to what's installed on the system
set_var("CC", "riscv64-unknown-elf-gcc"); // set the compiler to what's installed on the system
let ffi_srcs = vec![
"ffi/ffi.c",
"ffi/libc.c",
"ffi/libc_split.c",
"ffi/scanf.c",
];
let ffi_includes = vec![
"./",
];
let ffi_srcs = vec!["ffi/ffi.c", "ffi/libc.c", "ffi/libc_split.c", "ffi/scanf.c"];
let ffi_includes = vec!["./"];
let mut base_config = cc::Build::new();
let mut base_config = cc::Build::new();
base_config.target("riscv32imac-unknown-none-elf");
for inc in ffi_includes {
@ -27,5 +20,5 @@ fn main() {
}
base_config.define("XOUS", None);
base_config.define("NO_STD", None);
base_config.compile("libffi.a");
base_config.compile("libffi.a");
}

View file

@ -115,9 +115,9 @@ impl<'a> Read for PddbKey<'a> {
PddbRetcode::AccessDenied => {
Err(Error::new(ErrorKind::PermissionDenied, "Access denied"))
}
PddbRetcode::UnexpectedEof => Ok(0), /* I believe this is the "expected" behavior for
* reads that want to read beyond the current end
* of file */
PddbRetcode::UnexpectedEof => Ok(0), /* I believe this is the "expected" behavior for */
// reads that want to read beyond the current end
// of file
_ => {
log::error!("Unhandled error code: {:?}", pbuf.retcode);
Err(Error::new(ErrorKind::Other, "Unhandled error code in PddbKey Read"))