Brad Dunbar and GitHub
1bcd2129d1
get_vec_pos: use &self instead of &mut self ( #670 )
...
I can't see any reason that get_vec_pos needs a &mut self.
2024-02-06 17:34:30 -05:00
Brad Dunbar and GitHub
f586ffc525
set_vec_pos does not need a second parameter ( #672 )
...
The second argument to `set_vec_pos` always contains the value of
`self.data`. Let's just use `self.data` and remove the second parameter
altogether.
2024-02-06 11:03:37 -08:00
Brad Dunbar and GitHub
c6972d6132
Calculate original capacity only if necessary ( #666 )
...
We don't need the original capacity if the shared data is unique, so
let's not calculate it until after that check.
2024-02-06 10:46:49 -08:00
Brad Dunbar and GitHub
47e83056f2
Use sub instead of offset ( #668 )
...
We're always subtracting here, and we already have a usize, so `sub`
seems like a more appropriate usage to me.
2024-02-06 10:41:44 -08:00
Brad Dunbar and GitHub
8bcac21cb4
Restore commented tests ( #665 )
...
These seem to have been commented by accident in #298 , and are still
passing.
2024-02-06 10:17:01 -08:00
Brad Dunbar and GitHub
d2e7abdb29
refactor: make parameter mut in From<Vec> ( #667 )
...
Instead of re-declaring `vec`, we can just use a mut parameter.
2024-01-31 09:41:23 -05:00
Brad Dunbar and GitHub
e24587dd61
Remove unreachable else branch ( #661 )
2024-01-28 15:30:30 +03:30
Brad Dunbar and GitHub
9257a6ea08
Remove an unnecessary else branch ( #662 )
2024-01-28 14:20:56 +03:30
Brad Dunbar and GitHub
0ba3b4c4cd
Remove unnecessary namespace qualifier ( #660 )
2024-01-28 14:07:11 +03:30
Brad Dunbar and GitHub
abb4a2e66c
BytesMut: Assert alignment of Shared ( #652 )
...
Back in #362 , an assertion was added to ensure that the alignment of
bytes::Shared is even so we can use the least significant bit as a flag.
bytes_mut::Shared uses the same technique but has no such assertion so
I've added one here.
2024-01-19 11:08:27 +01:00
Brad Dunbar and GitHub
dbbdb63d76
Use self. instead of Self:: ( #642 )
...
I was a little confused about these calls using `Self::` instead of
`self.` here. Is there a reason to use the former instead of the latter?
2023-12-28 14:20:13 +09:00