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

Draft: explore type state for FSRepository #924

Closed
wants to merge 1 commit into from

Conversation

jrray
Copy link
Collaborator

@jrray jrray commented Nov 30, 2023

Exploring the idea of using the type state pattern to have two different flavors of an FSRepository, one that promises the user's renders directory exists, and one that doesn't, for use by cmd_clean (#923).

There are some type conversion todos left in the code, but I got this to the point where the non-test code will compile and in theory spfs clean would not attempt to create the user's render directory.

Looking for feedback on this approach or if there are any suggestions for an alternative approach. Something much simpler would be the tried and true pass-a-bool-down, since all I really want to accomplish is to skip creating one of the directories inside create. There's just a lot of abstraction between open_repository_from_string and the call to create.

This draft change doesn't offer any other advantages, like it doesn't prevent using a no-renders repo as if it were a yes-renders one. The distinction gets hidden behind the RepositoryHandle. I guess I'm saying I don't like this code but I thought I'd at least get a second opinion.

@jrray jrray requested a review from rydrman November 30, 2023 04:03
@jrray
Copy link
Collaborator Author

jrray commented Jan 7, 2025

Superseded by #1159.

@jrray jrray closed this Jan 7, 2025
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