Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Links trait from data #6

Open
uselessgoddess opened this issue Aug 1, 2022 · 1 comment
Open

Use Links trait from data #6

uselessgoddess opened this issue Aug 1, 2022 · 1 comment
Labels
Store:Traits Store: this applies to Store traits (Links, Doublets)

Comments

@uselessgoddess
Copy link
Member

uselessgoddess commented Aug 1, 2022

At the moment Doublets trait use Links trait. This is due to the fact that for a long time data::Links Error = Box<dyn Error>

This is now fixed at linksplatform/core-rs@a2cadfa.

However, data::Error still loses information. It may be worth impl Links for Doublets, instead of Doublets for Links

@uselessgoddess uselessgoddess added the Store:Traits Store: this applies to Store traits (Links, Doublets) label Aug 1, 2022
@uselessgoddess
Copy link
Member Author

uselessgoddess commented Aug 1, 2022

It may be worth impl Links for Doublets, instead of Doublets for Links

For example:

//! before
trait Foo {
    fn foo(&self);
}

trait Bar: Foo {
    fn bar(&self) {
        self.foo();
    }
}

//! after
trait Foo {
    fn foo(&self);
}

trait Bar {
    fn bar(&self);
}

impl Foo for Bar {
    fn foo(&self) {
        self.bar()
    } 
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Store:Traits Store: this applies to Store traits (Links, Doublets)
Projects
None yet
Development

No branches or pull requests

1 participant