-
Notifications
You must be signed in to change notification settings - Fork 975
Closed
Labels
C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE
Description
In this code snippet
self.coords.x -= rng.gen_range(-self.radius / 2. .. self.radius / 2.);Running rust format will change this code to
self.coords.x -= rng.gen_range(-self.radius / 2...self.radius / 2.);Which will make rustc unable to compile the file because 2...X is not a valid syntax for ranges, however having the space lets rustc know that 2 is supposed to be a float and the dots represent a range.
Proposed fix:
Either do not remove the spaces in this case, or add a 0 in the case of floats.
Metadata
Metadata
Assignees
Labels
C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE