diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-02-09 23:17:22 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-02-09 23:17:22 +0100 |
| commit | cf94c0cc512994ca847f1c376e86735c54a6ee59 (patch) | |
| tree | 414c46e79fef9ec56ca4424995b51b8369d5ffeb /src/field/id.rs | |
| parent | c402a8923d2e89607a007f46ee4cde15714d746d (diff) | |
Use a result for the parser
Diffstat (limited to 'src/field/id.rs')
| -rw-r--r-- | src/field/id.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/field/id.rs b/src/field/id.rs index 07e02b2..fa854de 100644 --- a/src/field/id.rs +++ b/src/field/id.rs @@ -76,8 +76,22 @@ pub enum ID { } impl ID { + #[must_use] pub fn from_u16(id: u16) -> Self { - use ID::*; + use ID::{ + AutomaticResponse, ChatID, ChatOptions, ChatSubject, CommunityBannerID, Data, + ErrorText, FileComment, FileCreateDate, FileCreatorString, FileModifyDate, FileName, + FileNameWithInfo, FileNewName, FileNewPath, FilePath, FileResumeData, FileSize, + FileType, FileTypeString, FileXferOptions, FolderItemCount, LegacyNewsCategoryListData, + NewsArticle1stChildArticle, NewsArticleData, NewsArticleDataFlavor, NewsArticleDate, + NewsArticleFlags, NewsArticleID, NewsArticleListData, NewsArticleNextArticle, + NewsArticleParentArticle, NewsArticlePoster, NewsArticlePrevArticle, + NewsArticleRecurseDel, NewsArticleTitle, NewsCategoryGUID, NewsCategoryListData, + NewsCategoryName, NewsPath, NoServerAgreement, Options, QuotingMessage, + ReferenceNumber, ServerAgreement, ServerBanner, ServerBannerType, ServerBannerUrl, + ServerName, TransferSize, Unknown, UserAccess, UserAlias, UserFlags, UserID, + UserIconID, UserLogin, UserName, UserNameWithInfo, UserPassword, Version, WaitingCount, + }; match id { 100 => ErrorText, 101 => Data, |