Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
create-prog-app
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iliya.saroukha
create-prog-app
Commits
18e92e9a
Commit
18e92e9a
authored
2 years ago
by
iliya.saroukha
Browse files
Options
Downloads
Patches
Plain Diff
storing print to stdout functions into separate file
parent
3d945ec0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/to_stdout/mod.rs
+43
-0
43 additions, 0 deletions
src/to_stdout/mod.rs
with
43 additions
and
0 deletions
src/to_stdout/mod.rs
0 → 100644
+
43
−
0
View file @
18e92e9a
use
ptree
::{
print_tree
,
TreeBuilder
};
pub
fn
algo_tree
()
{
let
tree
=
TreeBuilder
::
new
(
"<name_data_struct>"
.to_string
())
.begin_child
(
"struct"
.to_string
())
.add_empty_child
(
"<name_data_struct>.h"
.to_string
())
.add_empty_child
(
"<name_data_struct>.c"
.to_string
())
.end_child
()
.add_empty_child
(
"<name_main_file>.c"
.to_string
())
.add_empty_child
(
"Makefile"
.to_string
())
.build
();
print_tree
(
&
tree
)
.expect
(
"Not able to print"
);
println!
();
}
pub
fn
exam_tree
()
{
let
tree
=
TreeBuilder
::
new
(
"prog_seq_exam_<month>"
.to_string
())
.begin_child
(
"ex1"
.to_string
())
.add_empty_child
(
"ex1.c"
.to_string
())
.add_empty_child
(
"Makefile"
.to_string
())
.end_child
()
.begin_child
(
"ex..."
.to_string
())
.add_empty_child
(
"etc..."
.to_string
())
.end_child
()
.build
();
print_tree
(
&
tree
)
.expect
(
"Not able to print"
);
println!
();
}
pub
fn
print_menu
()
{
println!
();
println!
(
" --------------------------------------- "
);
println!
(
"|
\t
Welcome to CREATE-PROG-APP
\t
|"
);
println!
(
" --------------------------------------- "
);
println!
(
"What kind of template do you want?"
);
println!
();
println!
(
"1) Algo"
);
algo_tree
();
println!
(
"2) Exam"
);
exam_tree
();
}
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