parent
dc8045a20e
commit
7f4f627769
@ -1,11 +1,6 @@
|
|||||||
/custom_types/*
|
/*.d/*
|
||||||
/hello/*
|
hello
|
||||||
/primitives/*
|
primitives
|
||||||
/variable_bindings/*
|
variable_bindings
|
||||||
/types/*
|
|
||||||
|
|
||||||
!/custom_types/*.rs
|
!/*.d/*.rs
|
||||||
!/hello/*.rs
|
|
||||||
!/primitives/*.rs
|
|
||||||
!/variable_bindings/*.rs
|
|
||||||
!/types/*.rs
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#[allow(dead_code)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Person {
|
struct Person {
|
||||||
name: String,
|
name: String,
|
@ -1,3 +1,5 @@
|
|||||||
|
#[allow(unused_variables)]
|
||||||
|
#[allow(unused_assignments)]
|
||||||
fn main() {
|
fn main() {
|
||||||
let logical: bool = true;
|
let logical: bool = true;
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
type NanoSecond = u64;
|
||||||
|
type Inch = u64;
|
||||||
|
type U64 = u64;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let nanoseconds: NanoSecond = 5 as U64;
|
||||||
|
let inches: Inch = 2 as U64;
|
||||||
|
|
||||||
|
println!(
|
||||||
|
"{} nanoseconds + {} inches = {} unit?",
|
||||||
|
nanoseconds,
|
||||||
|
inches,
|
||||||
|
nanoseconds + inches
|
||||||
|
);
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
type NanoSecond = u64;
|
|
||||||
type Inch = u64;
|
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
|
||||||
type u64_t = u64;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let nanoseconds: NanoSecond = 5 as u64_t;
|
|
||||||
let inches: Inch = 2 as u64_t;
|
|
||||||
|
|
||||||
println!("{} nanoseconds + {} inches = {} unit?",
|
|
||||||
nanoseconds,
|
|
||||||
inches,
|
|
||||||
nanoseconds + inches);
|
|
||||||
}
|
|
Loading…
Reference in new issue