File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,20 @@ Once we feel comfortable with the implementation we'll remove the feature gate
50
50
and mark the traits as stable. This can be done after 1.0 as this change is
51
51
backwards compatible.
52
52
53
+ ## RHS: By ref vs by value
54
+
55
+ This RFC proposes that the assignment operations take the RHS always by ref;
56
+ instead of by value like the "normal" binary operations (e.g. ` Add ` ) do. The
57
+ rationale is that, as far as the author has seen in practice [ 1] , one never
58
+ wants to mutate the RHS or consume it, or in other words an immutable view into
59
+ the RHS is enough to perform the operation. Therefore, this RFC follows in the
60
+ footsteps of the ` Index ` traits, where the same situation arises with the
61
+ indexing value, and by ref was chosen over by value.
62
+
63
+ [ 1] It could be possible that the author is not aware of use cases where taking
64
+ RHS by value is necessary. Feedback on this matter would be appreciated. (See
65
+ the first unresolved question)
66
+
53
67
# Drawbacks
54
68
55
69
None that I can think of.
You can’t perform that action at this time.
0 commit comments