git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
#[test] | |
fn build_computer_test() { | |
let computer = build_computer("apple".to_string(), "abcde-100".to_string()); | |
println!("name {}", computer.name); | |
println!("serial {}", computer.serial); | |
println!("cpu_cnt {}", computer.cpu_cnt); | |
println!("ram_size {}", computer.ram_size); | |
let copy_cat = Computer{ |
#[test] | |
fn build_computer_test() { | |
let computer = build_computer("apple".to_string(), "abcde-100".to_string()); | |
let copy_cat = Computer{ | |
name: "Capple".to_string(), | |
..computer | |
}; | |
println!("{:?}", copy_cat); | |
} |
#[derive(Debug)] | |
struct Computer { | |
name: String, | |
serial: String, | |
cpu_cnt: u8, | |
ram_size: u64, | |
} |
#[derive(Debug)] | |
struct Computer { | |
serial: String, | |
model: String, | |
cpu: u32, | |
ram: u64, | |
} |
#[derive(Debug)] | |
struct Computer { | |
serial: String, | |
model: String, | |
cpu: u32, | |
ram: u64, | |
} | |
impl Computer { |
#[test] | |
fn method_test() { | |
let apple_ii = Computer{ | |
serial: String::from("APPLEISBEST!!"), | |
model: String::from("APPLE II"), | |
cpu: 32, | |
ram: 1024 * 100, | |
}; |
enum IpAddrKind { | |
V4(String), | |
V6(String) | |
} | |
enum IpAddrKindV2 { | |
V4(u8, u8, u8, u8), | |
V6(String) | |
} |
enum Message { | |
Quit, | |
Move {x: i32, y: i32}, | |
Write(String), | |
ChangeColor(i32, i32, i32), | |
} | |
impl Message { | |
fn call(&self) { | |
println!("Called~!!"); |
enum DDD { | |
s(String) | |
} | |
enum AAA { | |
TellMe(DDD) | |
} |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream