Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(02) Ticket Store (01) Store problem #37

Open
ghost opened this issue Nov 11, 2021 · 1 comment
Open

(02) Ticket Store (01) Store problem #37

ghost opened this issue Nov 11, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 11, 2021

Hello,

I have here to write a get so I did this :

pub fn get(&self, id: &u32) -> &Ticket {
        self.data.get(id)
     }

But that gives me a Option which we did not learn.
So is there another way to make this part work ?

@Zyhael
Copy link

Zyhael commented Aug 3, 2024

In the exercise the function should panic if a ticket id does not exist.
With rust-analyzer it will suggest to add a .expect(msg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant