File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 3131//!
3232//! ~~~{.rust}
3333//! extern mod extra;
34- //! use extra::getopts::{optopt,optflag,getopts};
34+ //! use extra::getopts::{optopt,optflag,getopts,Opt };
3535//! use std::os;
3636//!
3737//! fn do_work(inp: &str, out: Option<~str>) {
Original file line number Diff line number Diff line change @@ -38,11 +38,15 @@ there are three common kinds of strings in rust:
3838As an example, here's a few different kinds of strings.
3939
4040```rust
41- let owned_string = ~"I am an owned string";
42- let managed_string = @"This string is garbage-collected";
43- let borrowed_string1 = "This string is borrowed with the 'static lifetime";
44- let borrowed_string2: &str = owned_string; // owned strings can be borrowed
45- let borrowed_string3: &str = managed_string; // managed strings can also be borrowed
41+ #[feature(managed_boxes)];
42+
43+ fn main() {
44+ let owned_string = ~"I am an owned string";
45+ let managed_string = @"This string is garbage-collected";
46+ let borrowed_string1 = "This string is borrowed with the 'static lifetime";
47+ let borrowed_string2: &str = owned_string; // owned strings can be borrowed
48+ let borrowed_string3: &str = managed_string; // managed strings can also be borrowed
49+ }
4650 ```
4751
4852From the example above, you can see that rust has 3 different kinds of string
You can’t perform that action at this time.
0 commit comments