Skip to content

Misc cleanup: pub(crate) mock fields, log_println allow, current_processor_number, stdin guard#755

Open
wdcui wants to merge 1 commit intomainfrom
wdcui/pr3e-misc-cleanup
Open

Misc cleanup: pub(crate) mock fields, log_println allow, current_processor_number, stdin guard#755
wdcui wants to merge 1 commit intomainfrom
wdcui/pr3e-misc-cleanup

Conversation

@wdcui
Copy link
Copy Markdown
Member

@wdcui wdcui commented Apr 7, 2026

Summary

  • Make MockPlatform fields pub(crate) instead of fully public, since the mock is only used within the crate's test infrastructure.
  • Add #[allow(unused_imports)] for log_println! macro import (used conditionally).
  • Add current_processor_number() to SystemInfoProvider with a default returning 0, for getcpu-family syscall emulation.
  • Add a Drop guard to MockPlatform::read_stdin() to clear the stdin buffer on return.

Split from #743.

…essor_number, stdin guard

Small independent cleanups:

- Make MockInstant::time and MockSystemTime::time pub(crate) so tests
  in other modules can construct instances with specific values.
- Add #[allow(unused_imports)] to log_println! macro use-statements to
  suppress warnings when the macro is invoked in contexts where the
  import is redundant.
- Add SystemInfoProvider::current_processor_number() default method
  returning 0, for platforms that don't expose processor topology.
- Add empty-buffer early return in MockPlatform::read_from_stdin() to
  avoid unnecessarily consuming queued input on zero-length reads.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant