You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MidTermExam.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,9 +143,11 @@ pub enum Level {
143
143
144
144
Ayrıca bu enum yapısına **to_string** isimli bir metot ekleyip seviyeye göre şu ifadelerin döndürülmesini istiyoruz.
145
145
146
+
```text
146
147
Level::BURNING → "Aşırı kullanım!"
147
148
Level::NORMAL → "Her şey yolunda."
148
149
Diğer tüm durumlar → "Dikkat edilmesi gerekiyor."
150
+
```
149
151
150
152
Bu durumları ele almak için **pattern match** ifadesi kullanmak biçilmiş kaftan. Bu nedenle **to_string** metodu içerisinde **pattern match** kullanmaya karar verdiniz. Aşağıdaki şıklardan hangisi doğru ve idiomatic bir kullanım şeklidir.
0 commit comments