Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NeoSkeleton default length #5245

Closed
wants to merge 1 commit into from

Conversation

sffc
Copy link
Member

@sffc sffc commented Jul 16, 2024

Any objections?

Copy link
Member

@robertbastian robertbastian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how Long is more qualified as a default than Medium. Why do we need a default? Does this simplify the usage of the API?

@sffc
Copy link
Member Author

sffc commented Jul 16, 2024

The length is not being used for times and time zones, so this makes call sites a little easier to read. #5246

However, I'm now thinking I should just change the constructors to take an options bag where the length is one of the fields, like we do literally everywhere else, giving us more flexibility in the long run.

@sffc
Copy link
Member Author

sffc commented Jul 16, 2024

However, I'm now thinking I should just change the constructors to take an options bag where the length is one of the fields, like we do literally everywhere else, giving us more flexibility in the long run.

Even if I make this change, I still need a default length, because I can't load data without the length. Alternatively, I can make the constructor return an error if the length is not set in the API.

@sffc
Copy link
Member Author

sffc commented Jul 16, 2024

I guess another way around this is I can add another associated type to the trait system to suppress the need to pass a length into the constructor.

@sffc
Copy link
Member Author

sffc commented Jul 17, 2024

Okay, I tried adding a type parameter for the options bag. The length ends up being used fairly deep in the stack, including during the formatting calls to select the correct pattern. (This avoids a map_project in the constructor.) So, internally, I would likely need to still store an actual SkeletonLength but make it an Option<SkeletonLength> and GIGO if I need to retrieve it.

@sffc
Copy link
Member Author

sffc commented Jul 17, 2024

#5248

If #5248 is approved and merged, I will close this PR.

@sffc
Copy link
Member Author

sffc commented Jul 19, 2024

Made obsolete by #5248

@sffc sffc closed this Jul 19, 2024
@sffc sffc deleted the neoskeleton-default-length branch July 19, 2024 19:56
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.

3 participants