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 method VectorDiff::apply #41

Merged
merged 2 commits into from
Nov 6, 2023
Merged

Conversation

progval
Copy link
Contributor

@progval progval commented Nov 4, 2023

No description provided.

@jplatte
Copy link
Owner

jplatte commented Nov 6, 2023

Hey, thanks for the PR! Did you consider exposing this as ObservableVector::apply_diff instead? I think vector.apply_diff(diff) is probably easier to read than diff.apply(&mut vector).

@progval
Copy link
Contributor Author

progval commented Nov 6, 2023

Hmm, how about a trait PatchableVector { fn apply_diff(&mut self, diff: VectorDiff); }, implemented by imbl::Vector (for my use case), ObservableVector (for yours), and possibly others like Vec?

@jplatte
Copy link
Owner

jplatte commented Nov 6, 2023

Oh, this is for Vector! In that case it probably makes sense as-is (and also ObservableVector::apply would be more work to implement, so might not make sense yet w/o a use case).

eyeball-im/src/vector.rs Outdated Show resolved Hide resolved
@jplatte
Copy link
Owner

jplatte commented Nov 6, 2023

Hm, I think formatting is off here, but we don't have a CI job to check that. I guess I'll merge and take care of the remaining work separately.

@jplatte jplatte merged commit 938455d into jplatte:main Nov 6, 2023
@jplatte
Copy link
Owner

jplatte commented Nov 6, 2023

Released in eyeball-im 0.4.2.

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.

2 participants