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

try to backport the named parameter patch #79

Closed

Conversation

pillowtrucker
Copy link
Contributor

No description provided.

@pillowtrucker
Copy link
Contributor Author

I'm still not getting the whole arrows example for physics rendered even with this patch..
First run is with this patch, second main branch, third physics branch: https://dai.ly/k2FyniuCiLtKjCzXsFk

Copy link
Member

@Speykious Speykious left a comment

Choose a reason for hiding this comment

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

I didn't know parameters could be unnamed, it's good to use the provided UUIDs as IDs instead when we can. However, I requesteth changes

inox2d/src/params.rs Show resolved Hide resolved
inox2d/Cargo.toml Outdated Show resolved Hide resolved
.get(param_name)
.map(|pn| self.parameters.get(pn).expect("param index mismatch {pn}"))
.unwrap_or_else(|| panic!("No parameter named: {}", param_name));
Copy link
Member

Choose a reason for hiding this comment

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

.expect is not a format-like macro, it's just a function. So that {pn} is gonna display as {pn} and not the contents of pn. I suggest either removing that part, or (better solution) make get/set_param return a Result<T, ParamNotFound>, which will automatically also make the methods more resilient like we wanted a few days ago

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ehh yeah I wasn't paying attention to this so it might already be a Result in the other branch ? I'll check and copy
The inner error is a panic error though, the index having a reference to a non-existent value

test/test-physics/Cargo.toml Outdated Show resolved Hide resolved
@Speykious
Copy link
Member

Just realized parameters already have use the UUID in the physics branch...

@pillowtrucker
Copy link
Contributor Author

TLDR; I'm not really convinced this should be merged but I'm also not convinced the physics and main branch haven't diverged so much that a rebase will be just as much work as a rewrite

@Speykious
Copy link
Member

Physics is now fixed on the physics branch, so I think I'll close this

@Speykious Speykious closed this Feb 12, 2024
@pillowtrucker pillowtrucker deleted the unnamed-params-support branch February 12, 2024 09:07
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