stevedonovan / gentle-intro

A gentle Rust tutorial
MIT License
830 stars 113 forks source link

2-structs-enums-...: fix compilation problems in struct4.rs #106

Open vbendeb opened 3 years ago

vbendeb commented 3 years ago

Looks like some last minute edit was not tested, I get these warnings when trying to compile struct4.rs without this patch:

warning: unused import: `std::fmt`
 --> hello.rs:1:5
  |
1 | use std::fmt;
  |     ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: associated function is never used: `full_name`
  --> hello.rs:18:8
   |
18 |     fn full_name(&self) -> String {
   |        ^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: 2 warnings emitted

Thank you for writing and publishing the book, a great help for Rust newbies.