types: better Status parsing

This commit is contained in:
nixo 2020-10-25 10:43:30 +01:00
parent ee847f0f04
commit dbde2687a2
1 changed files with 2 additions and 1 deletions

View File

@ -15,7 +15,8 @@ struct Status
end
Status(code::String, meta::String) = Status(code[1], code[2], meta)
Status(code::String) = Status(code[1], code[2], "")
Status(code::String) =
Status(code[1], code[2], length(code) > 2 ? String(strip(code[3:end])) : "")
Status(code::Int, meta::String) = Status(string(code), meta)
Status(code::Int) = Status(string(code))