Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
29cf3167e459
Commit
29cf3167e459
authored
2 years ago
by
Raphaël Gomès
Browse files
Options
Downloads
Patches
Plain Diff
hg-core: remove unneeded trait now that we support Rust 1.52+
parent
c7fb9b74e753
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!485
branching: merge default into stable
,
!303
rust: upgrade supported Rust toolchain version and cascade upgrades
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rust/hg-core/src/lock.rs
+1
-2
1 addition, 2 deletions
rust/hg-core/src/lock.rs
rust/hg-core/src/utils.rs
+0
-15
0 additions, 15 deletions
rust/hg-core/src/utils.rs
with
1 addition
and
17 deletions
rust/hg-core/src/lock.rs
+
1
−
2
View file @
29cf3167
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
use
crate
::
errors
::
HgError
;
use
crate
::
errors
::
HgError
;
use
crate
::
errors
::
HgResultExt
;
use
crate
::
errors
::
HgResultExt
;
use
crate
::
utils
::
StrExt
;
use
crate
::
vfs
::
Vfs
;
use
crate
::
vfs
::
Vfs
;
use
std
::
io
;
use
std
::
io
;
use
std
::
io
::
ErrorKind
;
use
std
::
io
::
ErrorKind
;
...
@@ -107,7 +106,7 @@
...
@@ -107,7 +106,7 @@
/// running anymore.
/// running anymore.
fn
lock_should_be_broken
(
data
:
&
Option
<
String
>
)
->
bool
{
fn
lock_should_be_broken
(
data
:
&
Option
<
String
>
)
->
bool
{
(||
->
Option
<
bool
>
{
(||
->
Option
<
bool
>
{
let
(
prefix
,
pid
)
=
data
.as_ref
()
?
.split_
2
(
':'
)
?
;
let
(
prefix
,
pid
)
=
data
.as_ref
()
?
.split_
once
(
':'
)
?
;
if
prefix
!=
&*
LOCK_PREFIX
{
if
prefix
!=
&*
LOCK_PREFIX
{
return
Some
(
false
);
return
Some
(
false
);
}
}
...
...
This diff is collapsed.
Click to expand it.
rust/hg-core/src/utils.rs
+
0
−
15
View file @
29cf3167
...
@@ -145,21 +145,6 @@
...
@@ -145,21 +145,6 @@
}
}
}
}
pub
trait
StrExt
{
// TODO: Use https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_once
// once we require Rust 1.52+
fn
split_2
(
&
self
,
separator
:
char
)
->
Option
<
(
&
str
,
&
str
)
>
;
}
impl
StrExt
for
str
{
fn
split_2
(
&
self
,
separator
:
char
)
->
Option
<
(
&
str
,
&
str
)
>
{
let
mut
iter
=
self
.splitn
(
2
,
separator
);
let
a
=
iter
.next
()
?
;
let
b
=
iter
.next
()
?
;
Some
((
a
,
b
))
}
}
pub
trait
Escaped
{
pub
trait
Escaped
{
/// Return bytes escaped for display to the user
/// Return bytes escaped for display to the user
fn
escaped_bytes
(
&
self
)
->
Vec
<
u8
>
;
fn
escaped_bytes
(
&
self
)
->
Vec
<
u8
>
;
...
...
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