Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rusty-hektor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Grady Corp.
rusty-hektor
Commits
5c167cbc
Commit
5c167cbc
authored
5 years ago
by
robinwilliam.hundt
Browse files
Options
Downloads
Patches
Plain Diff
Changed parsing of submission code attribute
parent
58f58dee
No related branches found
No related tags found
No related merge requests found
Pipeline
#118823
passed
5 years ago
Stage: test
Stage: build
Stage: docs
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parser/xml_parser.rs
+4
-3
4 additions, 3 deletions
src/parser/xml_parser.rs
with
4 additions
and
3 deletions
src/parser/xml_parser.rs
+
4
−
3
View file @
5c167cbc
...
@@ -343,16 +343,17 @@ fn extract_submission_for_student(
...
@@ -343,16 +343,17 @@ fn extract_submission_for_student(
let
mut
val
=
el
let
mut
val
=
el
.attribute_value
(
"value1"
)
.attribute_value
(
"value1"
)
.expect
(
"No value1 attr found, unable to parse code"
);
.expect
(
"No value1 attr found, unable to parse code"
);
if
val
==
"0"
{
// TODO this seems rather brittle...
if
val
.len
()
==
1
{
val
=
el
val
=
el
.attribute_value
(
"value2"
)
.attribute_value
(
"value2"
)
.expect
(
"value1 is
0
but value2 attr not found, unable to parse code"
);
.expect
(
"value1 is
only one long,
but value2 attr not found, unable to parse code"
);
}
}
val
val
});
});
let
code
=
match
encoded_attr
{
let
code
=
match
encoded_attr
{
Some
(
val
)
=>
String
::
from_utf8
(
decode
(
val
)
?
)
?
,
Some
(
val
)
=>
String
::
from_utf8
(
decode
(
val
)
.expect
(
&
format!
(
"Unable to decode: {}"
,
&
val
))
)
?
,
None
=>
""
.to_string
(),
None
=>
""
.to_string
(),
};
};
...
...
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