Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Refinedrust Dev
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Gäher
Refinedrust Dev
Commits
c15f6d3f
Verified
Commit
c15f6d3f
authored
9 months ago
by
Vincent Lafeychine
Browse files
Options
Downloads
Patches
Plain Diff
clippy: Fix tests_outside_test_module
parent
673e707e
No related branches found
Branches containing commit
No related tags found
1 merge request
!47
Fix most of `clippy::restriction` and `clippy::pedantic`
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rr_frontend/.cargo/config.toml
+0
-1
0 additions, 1 deletion
rr_frontend/.cargo/config.toml
rr_frontend/rrconfig/src/arg_value.rs
+16
-11
16 additions, 11 deletions
rr_frontend/rrconfig/src/arg_value.rs
with
16 additions
and
12 deletions
rr_frontend/.cargo/config.toml
+
0
−
1
View file @
c15f6d3f
...
...
@@ -34,7 +34,6 @@ rustflags = [
# clippy::restriction
"-Aclippy::non_ascii_literal"
,
"-Aclippy::panic_in_result_fn"
,
"-Aclippy::tests_outside_test_module"
,
"-Aclippy::unneeded_field_pattern"
,
"-Aclippy::unwrap_in_result"
,
...
...
This diff is collapsed.
Click to expand it.
rr_frontend/rrconfig/src/arg_value.rs
+
16
−
11
View file @
c15f6d3f
...
...
@@ -30,16 +30,21 @@ pub fn arg_value<'a, T: Deref<Target = str>, F: Fn(&str) -> bool>(
None
}
#[test]
fn
test
_arg_value
()
{
let
args
=
&
[
"--bar=bar"
,
"--foobar"
,
"123"
,
"--foo"
]
;
#[
cfg(
test
)
]
mod
test
s
{
use
super
::
*
;
assert_eq!
(
arg_value
(
&
[]
as
&
[
&
str
],
"--foobar"
,
|
_
|
true
),
None
);
assert_eq!
(
arg_value
(
args
,
"--bar"
,
|
_
|
false
),
None
);
assert_eq!
(
arg_value
(
args
,
"--bar"
,
|
_
|
true
),
Some
(
"bar"
));
assert_eq!
(
arg_value
(
args
,
"--bar"
,
|
p
|
p
==
"bar"
),
Some
(
"bar"
));
assert_eq!
(
arg_value
(
args
,
"--bar"
,
|
p
|
p
==
"foo"
),
None
);
assert_eq!
(
arg_value
(
args
,
"--foobar"
,
|
p
|
p
==
"foo"
),
None
);
assert_eq!
(
arg_value
(
args
,
"--foobar"
,
|
p
|
p
==
"123"
),
Some
(
"123"
));
assert_eq!
(
arg_value
(
args
,
"--foo"
,
|
_
|
true
),
None
);
#[test]
fn
test_arg_value
()
{
let
args
=
&
[
"--bar=bar"
,
"--foobar"
,
"123"
,
"--foo"
];
assert_eq!
(
arg_value
(
&
[]
as
&
[
&
str
],
"--foobar"
,
|
_
|
true
),
None
);
assert_eq!
(
arg_value
(
args
,
"--bar"
,
|
_
|
false
),
None
);
assert_eq!
(
arg_value
(
args
,
"--bar"
,
|
_
|
true
),
Some
(
"bar"
));
assert_eq!
(
arg_value
(
args
,
"--bar"
,
|
p
|
p
==
"bar"
),
Some
(
"bar"
));
assert_eq!
(
arg_value
(
args
,
"--bar"
,
|
p
|
p
==
"foo"
),
None
);
assert_eq!
(
arg_value
(
args
,
"--foobar"
,
|
p
|
p
==
"foo"
),
None
);
assert_eq!
(
arg_value
(
args
,
"--foobar"
,
|
p
|
p
==
"123"
),
Some
(
"123"
));
assert_eq!
(
arg_value
(
args
,
"--foo"
,
|
_
|
true
),
None
);
}
}
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