feat: add rust-script
This commit is contained in:
3
external/rust-script/examples/hello-without-main.ers
vendored
Executable file
3
external/rust-script/examples/hello-without-main.ers
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env rust-script
|
||||
|
||||
println!("hello, rust");
|
||||
5
external/rust-script/examples/hello.ers
vendored
Executable file
5
external/rust-script/examples/hello.ers
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env rust-script
|
||||
|
||||
fn main() {
|
||||
println!("hello, rust");
|
||||
}
|
||||
12
external/rust-script/examples/time-main.ers
vendored
Normal file
12
external/rust-script/examples/time-main.ers
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env rust-script
|
||||
//! This is a regular crate doc comment, but it also contains a partial
|
||||
//! Cargo manifest. Note the use of a *fenced* code block, and the
|
||||
//! `cargo` "language".
|
||||
//!
|
||||
//! ```cargo
|
||||
//! [dependencies]
|
||||
//! time = "0.1.25"
|
||||
//! ```
|
||||
fn main() {
|
||||
println!("{}", time::now().rfc822z());
|
||||
}
|
||||
13
external/rust-script/examples/time-without-main.ers
vendored
Normal file
13
external/rust-script/examples/time-without-main.ers
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env rust-script
|
||||
/// This is a regular crate doc comment, but it also contains a partial
|
||||
/// Cargo manifest. Note the use of a *fenced* code block, and the
|
||||
/// `cargo` "language".
|
||||
///
|
||||
/// ```cargo
|
||||
/// [dependencies]
|
||||
/// time = "0.1.25"
|
||||
/// ```
|
||||
|
||||
use time::now;
|
||||
|
||||
println!("{}", now().rfc822z());
|
||||
Reference in New Issue
Block a user