Skip to content

Instantly share code, notes, and snippets.

View leopard627's full-sized avatar

Leopard627 leopard627

  • South Korea
  • 21:31 (UTC +09:00)
View GitHub Profile
#[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)
}
@leopard627
leopard627 / gist:b5b7098f021b1bb22a4e7ae0e5b6f357
Created January 19, 2019 16:02 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream