Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ece459-w23-a2
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
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
Patrick Lam
ece459-w23-a2
Commits
95fb618b
Commit
95fb618b
authored
1 year ago
by
Patrick Lam
Browse files
Options
Downloads
Patches
Plain Diff
rewrite to avoid compiler warning
parent
3f3feaf2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/packages/parser.rs
+2
-10
2 additions, 10 deletions
src/packages/parser.rs
with
2 additions
and
10 deletions
src/packages/parser.rs
+
2
−
10
View file @
95fb618b
...
...
@@ -189,11 +189,7 @@ fn process_dictionary_builder_line(line: String, lookahead_line: Option<String>,
for
doubles
in
tokens2
.windows
(
2
)
{
let
double_tmp
=
format!
(
"{}^{}"
,
doubles
[
0
],
doubles
[
1
]);
if
let
Some
(
count
)
=
dbl
.get
(
&
double_tmp
)
{
dbl
.insert
(
double_tmp
,
count
+
1
);
}
else
{
dbl
.insert
(
double_tmp
,
1
);
}
*
dbl
.entry
(
double_tmp
.to_owned
())
.or_default
()
+=
1
;
}
let
mut
tokens3_
=
match
prev2
{
...
...
@@ -206,11 +202,7 @@ fn process_dictionary_builder_line(line: String, lookahead_line: Option<String>,
};
for
triples
in
tokens3
.windows
(
3
)
{
let
triple_tmp
=
format!
(
"{}^{}^{}"
,
triples
[
0
],
triples
[
1
],
triples
[
2
]);
if
let
Some
(
count
)
=
trpl
.get
(
&
triple_tmp
)
{
trpl
.insert
(
triple_tmp
,
count
+
1
);
}
else
{
trpl
.insert
(
triple_tmp
,
1
);
}
*
trpl
.entry
(
triple_tmp
.to_owned
())
.or_default
()
+=
1
;
}
return
(
last1
,
last2
);
}
...
...
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