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
37921c5c
Commit
37921c5c
authored
5 years ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
mises a jour diverses
parent
41eedb11
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#5677
passed
5 years ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
presentation/codes/ownership/src/main.rs
+12
-4
12 additions, 4 deletions
presentation/codes/ownership/src/main.rs
presentation/intro.md
+1
-1
1 addition, 1 deletion
presentation/intro.md
with
13 additions
and
5 deletions
presentation/codes/ownership/src/main.rs
+
12
−
4
View file @
37921c5c
fn
do_something
(
_notebook
:
Vec
<
&
str
>
)
{
// _notebook prend l'ownership
fn
do_something
(
_notebook
:
Vec
<
String
>
)
{
// _notebook prend l'ownership
// Do something with the library
}
// _notebook est détruit et ses données aussi
fn
main
()
{
let
mut
notebook
=
Vec
::
new
();
// par défaut notebook est immutable
notebook
.push
(
"Il fait beau."
);
notebook
.push
(
"Les oiseaux chantent."
);
notebook
.push
(
String
::
from
(
"Il fait beau."
)
)
;
notebook
.push
(
String
::
from
(
"Les oiseaux chantent."
)
)
;
do_something
(
notebook
);
// ownership transféré à do_something
// do_something(notebook); // redo something
}
\ No newline at end of file
let
a
=
1
;
let
raw
=
&
a
as
*
const
i32
;
let
b
=
unsafe
{
*
raw
};
println!
(
"{}"
,
unsafe
{
*
raw
});
}
This diff is collapsed.
Click to expand it.
presentation/intro.md
+
1
−
1
View file @
37921c5c
...
...
@@ -16,7 +16,7 @@ pdfMaxPagesPerSlide:
-
Rendu public la première fois en 2012 (version 0.4).
-
Première version stable (1.0) en 2015.
-
Stabilisation de fonctionnalités tous les 6 semaines.
-
Version stable actuelle 1.3
1.1
<!-- TODO UPDATE -->
-
Version stable actuelle 1.3
2.
<!-- TODO UPDATE -->
## Un développement pragmatique
...
...
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