-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
} | ||
} | ||
|
||
impl ToTypedValue for Timespec { | ||
fn to_typed_value(&self) -> TypedValue { | ||
// TODO: shouldn't that be / 1000?! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fluffyemily I didn't change the logic here, but superficially this looks like a bug…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a bug. And quite plainly crashes the code. How has this not been found before? We store Timespec
's all the time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably you only ever test this in native code, and you build libtoodle.a
in release mode, which I imagine permits overflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to pretend to understand your use ordering (why is ffi_utils
ordered with std
and time
, but store
is ordered with items
and labels
?), but assuming there is some sort of logic to it, it has my rubber stamp.
The ordering I've been using is almost certainly not mine, and is loosely based on Java conventions: At the top, general-purpose
Then "domain crates" — Mentat, in our case.
Then subcrates — crates in the same workspace. (Rust might treat these specially in the future for traits, but it also makes it easier to find what uses what.)
Then the
Then module imports and re-exports:
Then module uses:
Clearly I screwed up a little here by putting Naturally the mod/use/etc. sequence can be slightly perturbed by macro dependencies, which is a good reason to put macros in |
Hence my confusion as |
Very difficult to tell apart a subcrate from a dependency! This is one reason we prefixed all of Mentat's subcrates. |
Much less code, much less fragmented imports, fewer explicit dependencies. Tests pass.
Note that this temporarily points to my fix-the-world PR, which needs to land alongside this.