Repository navigation
refactor(proto): call the std-only float math through crate-root helpers - #848
Conversation
0453fd6 to
23763d7
Compare
23763d7 to
c21dbc3
Compare
flub
left a comment
There was a problem hiding this comment.
Any reason this is still in draft? A few notes but generally it looks good.
| #[cfg(all(target_family = "wasm", target_os = "unknown"))] | ||
| pub(crate) use web_time::{Instant, SystemTime, UNIX_EPOCH}; | ||
|
|
||
| // Deal with float math |
There was a problem hiding this comment.
Can you make this a full doc comment and add an explanation of why we're doing things this way?
There was a problem hiding this comment.
Good call, done.
There was a problem hiding this comment.
Do you want to add more methods here to be more future proof in case other methods start being used? They could say something like "add this to crate::math module" or something similar, no need to add the code for all of them. Though I'm not sure how extensive this list is, or whether you can use wildcards.
There was a problem hiding this comment.
Looks like clippy doesn't have wildcards for method paths, listed them all :p 2206a92
…math-helpers # Conflicts: # noq-proto/clippy.toml # noq-proto/src/bloom_token_log.rs # noq-proto/src/lib.rs
The 37 methods per type are the stable ones that Rust 1.99 has in std but not in core. Clippy takes no wildcard in a method path, so each method has its own entry. The reason tells the developer to add a helper to crate::math.
Was waiting for the |
ah, apologies. but yeah, this is fine. thanks for the gradual approach to making noq more no_std-friendly! |
* upstream/main: (24 commits) refactor(proto): call the std-only float math through crate-root helpers (n0-computer#848) refactor(proto): Avoid PathId allocation when building PATH_ACKS (n0-computer#901) chore: Release chore(deps): fix unused crates warnings of rust 1.100 (n0-computer#899) chore: Update issue template checkboxes (n0-computer#897) chore: humantime is unmaintained (n0-computer#900) chore(ci): fix workflows for test binaries locations (n0-computer#896) fix(perf): don't enable qlog feature in perf binary (n0-computer#850) fix(proto): track the key update boundary per path (n0-computer#869) tests: additional stream affinity tests (n0-computer#890) feat: allow streams to set an affinity for a path, simple version (n0-computer#881) fix(udp): handle receive errors before truncation flags in recv_single (n0-computer#884) chore: Upgrade async-executor and allow warnings in patchbay build (n0-computer#888) chore: Use shared minimal-crates worksflow (n0-computer#862) tests: Increase local slow-tests timeout (n0-computer#860) fix(proto): keep unread data when compacting an unordered stream (n0-computer#867) fix(proto): coalesce contiguous chunks during defragment (n0-computer#866) deps: Bump tokio for RUSTSEC-2026-0386 (n0-computer#868) feat(proto): Implement `noq_proto::SendStream::set_affinity` (n0-computer#836) fix(ci): bump deps for illumos (n0-computer#856) ...
Description
Closes #847
round,cbrt, andpowionf64exist only instd. With the calls going through amathmodule at the crate root, a build withoutstdcan switch them tolibmin one place.clippy.tomlprevents new code from calling thestdmethods directly.API Changes
None
Notes & open questions
Design notes
std, the inherentf64methods win over trait methods, so the trait import would be unused and warn, anddisallowed_methodswould flag every call.math::roundtoo, because the lint also checks test code.Change checklist
cargo makepasses locally.