Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
rust
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
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
orestis.malaspin
rust
Commits
07d4b980
There was a problem fetching the pipeline summary.
Commit
07d4b980
authored
6 years ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
ajout destruct
parent
e44a48de
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
types_avances.md
+23
-17
23 additions, 17 deletions
types_avances.md
with
23 additions
and
17 deletions
types_avances.md
+
23
−
17
View file @
07d4b980
...
...
@@ -4,22 +4,6 @@ subtitle: Types avancés
author
:
Orestis Malaspinas
<!-- date
:
25 avril 2018 -->
sansfont
:
Sans Serif
<!-- header-includes
:
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css" >
<link rel="stylesheet" href="reveal.js/css/theme/simple.css" id="theme">
<link rel="stylesheet" href="css/console.css" id="theme">
<script src="jquery/dist/jquery.min.js"></script> -->
<!-- <script src="reveal.js/lib/js/classList.js"></script> -->
<!-- <script src="reveal.js/plugin/zoom-js/zoom.js"></script> -->
<!-- <script src="reveal.js/plugin/highlight/highlight.js"></script> -->
<!-- <script src="js/remote-diagrams.js"></script> -->
<!-- <script src="reveal.js/plugin/notes/notes.js"></script> -->
<!-- include-after
:
<script src="js/playRust.js"></script>
<script src="js/remote-code.js"></script>
<script src="js/remote-diagrams.js"></script>
<script src="js/em-artiste.js"></script> -->
<!-- slide-numbers
:
true
-->
---
# $N$-uplets
...
...
@@ -43,8 +27,30 @@ sansfont: Sans Serif
## Destructuration
-
On peut destructurer un $n$-uplet avec la notation
`let (a,b,c,...) = tuple;`
{.rust}
-
Les champs sont accessibles avec la notation
`
let a = tuple.0;
let b = tuple.1;
`
{.rust}
<pre><code
data-trim=
"hljs rust"
class=
"lang-rust"
>
fn main() {
let tuple = (1.0, 'c', 18usize);
let (fl, ch, us) = tuple;
println!("Le tuple destructuré: {}, {}, {}", fl, ch, us);
let fl_ind = tuple.0;
let ch_ind = tuple.1;
let us_ind = tuple.2;
println!("Le tuple re-destructuré: {}, {}, {}", fl_ind, ch_ind, us_ind);
}
</code></pre>
# Vecteurs statiques
## Array{.rust}
...
...
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