Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
C programming 2nd term
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ильин Владимир Александрович
C programming 2nd term
Commits
9fea1004
Commit
9fea1004
authored
May 11, 2024
by
Ильин Владимир Александрович
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor ownership fix
parent
6a4ca30f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
8.rs
rust/lr1/src/8.rs
+8
-2
No files found.
rust/lr1/src/8.rs
View file @
9fea1004
...
@@ -40,7 +40,7 @@ impl Employee{
...
@@ -40,7 +40,7 @@ impl Employee{
}
}
}
}
}
}
fn
employed_on_position
(
employees
:
Vec
<
Employee
>
,
position
:
Position
)
->
Vec
<
Employee
>
fn
employed_on_position
(
employees
:
&
Vec
<
Employee
>
,
position
:
Position
)
->
Vec
<
Employee
>
{
{
let
mut
on_picked_position
:
Vec
<
Employee
>
=
Vec
::
new
();
let
mut
on_picked_position
:
Vec
<
Employee
>
=
Vec
::
new
();
...
@@ -70,11 +70,17 @@ fn main()
...
@@ -70,11 +70,17 @@ fn main()
position
:
Position
::
Designer
,
position
:
Position
::
Designer
,
salary
:
1200.0
,
salary
:
1200.0
,
}];
}];
let
managers
=
employed_on_position
(
employees
,
Position
::
Manager
);
let
managers
=
employed_on_position
(
&
employees
,
Position
::
Manager
);
let
developers
=
employed_on_position
(
&
employees
,
Position
::
Developer
);
println!
(
"Managers:"
);
println!
(
"Managers:"
);
for
employee
in
managers
{
for
employee
in
managers
{
println!
(
"
\t
{} - {} - {}"
,
employee
.name
,
employee
.position
.position_to_string
(),
employee
.salary
);
println!
(
"
\t
{} - {} - {}"
,
employee
.name
,
employee
.position
.position_to_string
(),
employee
.salary
);
}
}
println!
(
"Developers:"
);
for
employee
in
developers
{
println!
(
"
\t
{} - {} - {}"
,
employee
.name
,
employee
.position
.position_to_string
(),
employee
.salary
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment