feat: Point coordinate regulators #118
1 changed files with 4 additions and 2 deletions
|
@ -688,7 +688,9 @@ impl Assembly {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn try_insert_element(&self, elt: impl Element + 'static) -> bool {
|
pub fn try_insert_element(&self, elt: impl Element + 'static) -> bool {
|
||||||
let can_insert = self.elements_by_id.with_untracked(|elts_by_id| !elts_by_id.contains_key(elt.id()));
|
let can_insert = self.elements_by_id.with_untracked(
|
||||||
|
|||||||
|
|elts_by_id| !elts_by_id.contains_key(elt.id())
|
||||||
|
);
|
||||||
if can_insert {
|
if can_insert {
|
||||||
self.insert_element_unchecked(elt);
|
self.insert_element_unchecked(elt);
|
||||||
}
|
}
|
||||||
|
@ -956,7 +958,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
Vectornaut
commented
I'd indent this line by two tabs to match the convention you've used for other multi-line expressions. This won't affect the string, because the string continuation escape absorbs all subsequent whitespace, resuming the string at the next non-whitespace character. I'd indent this line by two tabs to match the convention you've used for other multi-line expressions. This won't affect the string, because the [string continuation escape](https://doc.rust-lang.org/reference/expressions/literal-expr.html#string-continuation-escapes) absorbs all subsequent whitespace, resuming the string at the next non-whitespace character.
glen
commented
Ah, didn't know that \ at end of line (a convention I hate, but apparently the only one available in this context) sucked up leading whitespace on the next line as well. Will do. Ah, didn't know that \ at end of line (a convention I hate, but apparently the only one available in this context) sucked up leading whitespace on the next line as well. Will do.
|
|||||||
#[should_panic(expected = "Subject \"sphere1\" must be indexed before \
|
#[should_panic(expected = "Subject \"sphere1\" must be indexed before \
|
||||||
inversive distance regulator writes problem data")]
|
inversive distance regulator writes problem data")]
|
||||||
Vectornaut marked this conversation as resolved
Vectornaut
commented
When I originally wrote this test, it bothered me that the identifiers When I originally wrote this test, it bothered me that the identifiers `sphere0` and `sphere1` were assigned but never tested. The new, more informative indexing error message makes them part of the test, which is very satisfying.
|
|||||||
fn unindexed_subject_test_inversive_distance() {
|
fn unindexed_subject_test_inversive_distance() {
|
||||||
let _ = create_root(|| {
|
let _ = create_root(|| {
|
||||||
let subjects = [0, 1].map(
|
let subjects = [0, 1].map(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue
Flagging this as a potential mistake because it adds a new change to the pull request, rather than reverting one of the changes in commit
c0e6ebf
, and I don't see an obvious reason for this pull request to touch it. Could you confirm that this change was deliberate if it was, and revert it if it wasn't?Oh, when I was undoing, there was some exactly analogous line that was the other way, so it was easy just to falsely revert this. I will fix the mistaken non-reversion.