Commit Graph

3 Commits

Author SHA1 Message Date
vasilito 67de313411 refactor: box large Error variants (Command, Pkgar) to fix result_large_err
Boxing the Command(Command, ExitStatus) variant (204 bytes) and
Pkgar(pkgar::Error) variant (272 bytes) reduces the Error enum from
272+ bytes to ~80 bytes, eliminating all 70 result_large_err warnings.

Changes:
- Error::Command(Command, ExitStatus) → Command(Box<(Command, ExitStatus)>)
- Error::Pkgar(pkgar::Error) → Pkgar(Box<pkgar::Error>)
- Updated 2 construction sites in fs.rs (Command)
- Updated 1 construction site in package.rs (Pkgar)
- Updated 1 From conversion in lib.rs (Pkgar)
- Updated Display match in lib.rs (Command destructuring)

This is a heap allocation on error paths only — zero cost on the happy path.
Box<T> auto-implements Display/Debug when inner type does, so formatting
is unchanged.

Verification: cargo check , cargo test --lib  38/38.
Clippy: 74 → 4 warnings (70 eliminated).
2026-07-18 18:05:20 +09:00
vasilito 0c541f6161 refactor: auto-fix 100 clippy warnings (needless_borrow, collapsible_if, len_zero, etc.)
cargo clippy --fix reduced warnings from 196 to 96 (51% reduction).

Categories fixed:
- needless_borrow (52): removed redundant & on already-referenced values
- collapsible_if (20): nested ifs → single if with let chains (Rust 2024)
- len_zero (8): x.len() == 0 → x.is_empty()
- redundant_field_names (4): field: field → field
- needless_return (3): removed trailing return
- redundant_closure (2): |x| f(x) → f
- Other mechanical (11): useless_conversion, map_entry, derivable_impls, etc.

Verification: cargo check , cargo test --lib  38/38, cargo clippy 96 remaining
(down from 196). No behavior change — all fixes are semantic equivalents.

Remaining 96 warnings:
- 70 result_large_err (architectural: box Error enum variants)
- 12 ptr_arg (API signature: &PathBuf → &Path)
- 14 other (manual evaluation needed)
2026-07-18 17:48:55 +09:00
vasilito 50b731f1b7 Red Bear OS — microkernel OS in Rust, based on Redox
Derivative of Redox OS (https://www.redox-os.org) adding:
- AMD GPU driver (amdgpu) via LinuxKPI compat layer
- ext4 filesystem support (ext4d scheme daemon)
- ACPI fixes for AMD bare metal (x2APIC, DMAR, IVRS, MCFG)
- Custom branding (hostname, os-release, boot identity)

Build system is full upstream Redox with RBOS overlay in local/.
Patches for kernel, base, and relibc are symlinked from local/patches/
and protected from make clean/distclean. Custom recipes live in
local/recipes/ with symlinks into the recipes/ search path.

Build:  make all CONFIG_NAME=redbear-full
Sync:   ./local/scripts/sync-upstream.sh
2026-04-12 19:05:00 +01:00