tokio-rs / toasty

An async ORM for Rust (incubating)
MIT License
590 stars 18 forks source link

unwrap on None #1

Closed codegod100 closed 1 day ago

codegod100 commented 2 days ago

/src/toasty/src/relation/belongs_to.rs:36:29:


impl<T: fmt::Debug> fmt::Debug for BelongsTo<T> {
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
        self.value.as_ref().unwrap().fmt(fmt)
    }
}

as_ref() is None when I try to println one of my structs and throws a panic

codegod100 commented 2 days ago

https://github.com/tokio-rs/toasty/pull/2

codegod100 commented 2 days ago

See #6