File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,16 @@ impl Add for TextInfo {
49
49
impl AddAssign for TextInfo {
50
50
#[ inline]
51
51
fn add_assign ( & mut self , other : TextInfo ) {
52
- * self = * self + other;
52
+ let Self {
53
+ bytes,
54
+ chars,
55
+ utf16_surrogates,
56
+ line_breaks,
57
+ } = self ;
58
+ * bytes += other. bytes ;
59
+ * chars += other. chars ;
60
+ * utf16_surrogates += other. utf16_surrogates ;
61
+ * line_breaks += other. line_breaks ;
53
62
}
54
63
}
55
64
@@ -69,6 +78,15 @@ impl Sub for TextInfo {
69
78
impl SubAssign for TextInfo {
70
79
#[ inline]
71
80
fn sub_assign ( & mut self , other : TextInfo ) {
72
- * self = * self - other;
81
+ let Self {
82
+ bytes,
83
+ chars,
84
+ utf16_surrogates,
85
+ line_breaks,
86
+ } = self ;
87
+ * bytes -= other. bytes ;
88
+ * chars -= other. chars ;
89
+ * utf16_surrogates -= other. utf16_surrogates ;
90
+ * line_breaks -= other. line_breaks ;
73
91
}
74
92
}
You can’t perform that action at this time.
0 commit comments