Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bytes-sgx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Markus Becker
bytes-sgx
Commits
93c08064
Commit
93c08064
authored
8 years ago
by
Carl Lerche
Browse files
Options
Downloads
Patches
Plain Diff
Fix BytesMut refcounting
parent
2b796d40
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/buf/byte.rs
+0
-1
0 additions, 1 deletion
src/buf/byte.rs
src/bytes.rs
+4
-4
4 additions, 4 deletions
src/bytes.rs
with
4 additions
and
5 deletions
src/buf/byte.rs
+
0
−
1
View file @
93c08064
...
...
@@ -224,4 +224,3 @@ impl Clone for ByteBuf {
}
}
}
This diff is collapsed.
Click to expand it.
src/bytes.rs
+
4
−
4
View file @
93c08064
...
...
@@ -148,7 +148,7 @@ impl<'a> IntoBuf for &'a Bytes {
impl
Clone
for
Bytes
{
fn
clone
(
&
self
)
->
Bytes
{
Bytes
{
inner
:
self
.inner
.clone
()
}
Bytes
{
inner
:
self
.inner
.
shallow_
clone
()
}
}
}
...
...
@@ -253,7 +253,7 @@ impl BytesMut {
///
/// Panics if `at > capacity`
pub
fn
split_off
(
&
mut
self
,
at
:
usize
)
->
BytesMut
{
let
mut
other
=
self
.clone
();
let
mut
other
=
self
.
shallow_
clone
();
other
.set_start
(
at
);
self
.set_end
(
at
);
...
...
@@ -273,7 +273,7 @@ impl BytesMut {
///
/// Panics if `at > len`
pub
fn
drain_to
(
&
mut
self
,
at
:
usize
)
->
BytesMut
{
let
mut
other
=
self
.clone
();
let
mut
other
=
self
.
shallow_
clone
();
other
.set_end
(
at
);
self
.set_start
(
at
);
...
...
@@ -357,7 +357,7 @@ impl BytesMut {
/// Increments the ref count. This should only be done if it is known that
/// it can be done safely. As such, this fn is not public, instead other
/// fns will use this one while maintaining the guarantees.
fn
clone
(
&
self
)
->
BytesMut
{
fn
shallow_
clone
(
&
self
)
->
BytesMut
{
BytesMut
{
mem
:
self
.mem
.clone
(),
..
*
self
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment