Improve controller endpoint and model
This commit is contained in:
parent
2f51ebf91e
commit
6400b7745c
5 changed files with 103 additions and 7 deletions
|
@ -67,9 +67,12 @@ impl<'r> Decode<'r, Sqlite> for ControllerUid {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<&str> for ControllerUid {
|
||||
fn from(value: &str) -> Self {
|
||||
Self(Uuid::from_str(value).unwrap())
|
||||
impl TryFrom<&str> for ControllerUid {
|
||||
type Error = uuid::Error;
|
||||
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
let uuid = Uuid::from_str(value)?;
|
||||
Ok(Self(uuid))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue