Skip to content

Instantly share code, notes, and snippets.

@ihcsim
Last active February 1, 2022 21:55
Show Gist options
  • Save ihcsim/56a384fb01067003ba2faba7499e9584 to your computer and use it in GitHub Desktop.
Save ihcsim/56a384fb01067003ba2faba7499e9584 to your computer and use it in GitHub Desktop.
#[derive(Debug)]
struct Service {
name: String,
namespace: String,
}
fn main() {
let svc1 = Service {
name: "nginx".to_string(),
namespace: "default".to_string(),
};
let svc2 = Service {
name: "haproxy".to_string(),
namespace: svc1.namespace,
};
println!("{:?}\n{:?}", svc1, svc2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment