Skip to content

port rtc to rust#1483

Open
rbran wants to merge 3 commits intocopy:masterfrom
rbran:rtc-rust
Open

port rtc to rust#1483
rbran wants to merge 3 commits intocopy:masterfrom
rbran:rtc-rust

Conversation

@rbran
Copy link

@rbran rbran commented Jan 11, 2026

It's a mostly 1-1 migration to rust, except for the alarm, instead of storing the full date, just store and compare the hour/minute/second.

There are multiple parts of the code that I didn't understand or could be improved, but I decided to do a simple migration for now, to make this review as simple as possible.

@copy
Copy link
Owner

copy commented Jan 26, 2026

This doesn't seem to build right now.

@rbran
Copy link
Author

rbran commented Jan 26, 2026

Well, this was a weird "it works on my computer", after a make clean; make all; make eslint seem to fix this.

@rbran rbran force-pushed the rtc-rust branch 2 times, most recently from 652caa3 to fc46e5e Compare January 26, 2026 18:09
@rbran
Copy link
Author

rbran commented Feb 1, 2026

The CI fails because rust fmt is configured to use nightly features, but the make file uses the default cargo version:

$ make rustfmt
cargo fmt --all -- --check --config fn_single_line=true,control_brace_style=ClosingNextLine
Warning: can't set `fn_single_line = true`, unstable features are only available in nightly channel.
Warning: can't set `imports_indent = Block`, unstable features are only available in nightly channel.
Warning: can't set `control_brace_style = ClosingNextLine`, unstable features are only available in nightly channel.
@copy
Copy link
Owner

copy commented Feb 17, 2026

There are failing tests.

@rbran
Copy link
Author

rbran commented Feb 20, 2026

Those tests also seems to fail on the master branch.
All tests other then tests/api/floppy.js and tests/api/cdrom-insert-eject.js works fine on master and this PR.

@SuperMaxusa
Copy link
Contributor

instead of storing the full date, just store and compare the hour/minute/second.

I'm a bit worried if this will break compatibility with old state files.

@rbran
Copy link
Author

rbran commented Feb 23, 2026

I'm a bit worried if this will break compatibility with old state files.

I updated the code to include a proper state saving/restoring. Now it's able to save and load states from before and after this PR.

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

Labels

None yet

3 participants