Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rust-warmup
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
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
483-fa23
starter-code
rust-warmup
Commits
7900f8c8
Commit
7900f8c8
authored
1 year ago
by
Max New
Browse files
Options
Downloads
Patches
Plain Diff
add submission zip script, fix compilation errors
parent
28502f81
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+9
-4
9 additions, 4 deletions
README.md
mk-submission.sh
+3
-0
3 additions, 0 deletions
mk-submission.sh
src/arith.rs
+1
-1
1 addition, 1 deletion
src/arith.rs
src/lib.rs
+3
-1
3 additions, 1 deletion
src/lib.rs
with
16 additions
and
6 deletions
README.md
+
9
−
4
View file @
7900f8c8
...
...
@@ -10,7 +10,12 @@ least) the following files:
2.
`src/lib.rs`
3.
`src/arith.rs`
If you get a compilation error, make sure that your zip file contains
the files themselves, not the directory containing them. That is,
running
`unzip submission.zip`
in an empty directory
`tmp`
should
add
`Cargo.toml`
, and a directory
`src`
directly to
`tmp`
.
The simplest way to do this is to use the
`mk-submission.sh`
script
included in this directory, which will create a file
`submission.zip`
that includes the above files.
If you get an error that says you did not include the above files,
make sure that your zip file contains the files themselves, not the
directory containing them. That is, running
`unzip submission.zip`
in
an empty directory
`tmp`
should add
`Cargo.toml`
, and a directory
`src`
directly to
`tmp`
.
This diff is collapsed.
Click to expand it.
mk-submission.sh
0 → 100755
+
3
−
0
View file @
7900f8c8
#!/bin/bash
zip
-r
submission.zip Cargo.toml src/arith.rs src/lib.rs
This diff is collapsed.
Click to expand it.
src/arith.rs
+
1
−
1
View file @
7900f8c8
...
...
@@ -58,7 +58,7 @@ pub enum Arith {
correct value for x is 2.
*/
/* ARITH EXERCISE 0: Env */
fn
get
(
env
:
&
[(
&
str
,
i32
)],
x
:
&
str
)
->
Option
<
i32
>
{
pub
fn
get
(
env
:
&
[(
&
str
,
i32
)],
x
:
&
str
)
->
Option
<
i32
>
{
panic!
(
"NYI: get"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
3
−
1
View file @
7900f8c8
...
...
@@ -35,7 +35,9 @@ mod smallest_string_tests {
* slices to get an Option and either use pattern matching or the `?`
* operator to implement the correct behavior.
*/
pub
fn
add_them_up
(
v
:
&
[
i32
])
->
Option
<
i32
>
{}
pub
fn
add_them_up
(
v
:
&
[
i32
])
->
Option
<
i32
>
{
panic!
(
"not yet implemented: add_them_up"
)
}
#[cfg(test)]
mod
add_them_up_tests
{
...
...
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