@@ -7,7 +7,7 @@ package up your Rust code and share it with other people. This tutorial will
7
7
get you started on all of the concepts and commands you need to give the gift
8
8
of Rust code to someone else.
9
9
10
- ## Installing External Packages
10
+ # Installing External Packages
11
11
12
12
First, let's try to use an external package somehow. I've made a sample package
13
13
called ` hello ` to demonstrate how to do so. Here's how ` hello ` is used:
@@ -68,7 +68,7 @@ Hello, world.
68
68
69
69
Simple! That's all it takes.
70
70
71
- ## Workspaces
71
+ # Workspaces
72
72
73
73
Before we can talk about how to make packages of your own, you have to
74
74
understand the big concept with ` rustpkg ` : workspaces. A 'workspace' is simply
@@ -88,14 +88,14 @@ There are also default file names you'll want to follow as well:
88
88
* ` main.rs ` : A file that's going to become an executable.
89
89
* ` lib.rs ` : A file that's going to become a library.
90
90
91
- ## Building your own Package
91
+ # Building your own Package
92
92
93
93
Now that you've got workspaces down, let's build your own copy of ` hello ` . Go
94
94
to wherever you keep your personal projects, and let's make all of the
95
95
directories we'll need. I'll refer to this personal project directory as
96
96
` ~/src ` for the rest of this tutorial.
97
97
98
- ### Creating our workspace
98
+ ## Creating our workspace
99
99
100
100
~~~ {.notrust}
101
101
$ cd ~/src
@@ -150,15 +150,15 @@ pub fn world() {
150
150
151
151
Put this into ` src/hello/lib.rs ` . Let's talk about each of these attributes:
152
152
153
- ### Crate attributes for packages
153
+ ## Crate attributes for packages
154
154
155
155
` license ` is equally simple: the license we want this code to have. I chose MIT
156
156
here, but you should pick whatever license makes the most sense for you.
157
157
158
158
` desc ` is a description of the package and what it does. This should just be a
159
159
sentence or two.
160
160
161
- ### Building your package
161
+ ## Building your package
162
162
163
163
Building your package is simple:
164
164
@@ -206,7 +206,7 @@ note: Installed package github.com/YOUR_USERNAME/hello-0.1 to /home/yourusername
206
206
207
207
That's it!
208
208
209
- ## More resources
209
+ # More resources
210
210
211
211
There's a lot more going on with ` rustpkg ` , this is just to get you started.
212
212
Check out [ the rustpkg manual] ( rustpkg.html ) for the full details on how to
0 commit comments