DEV Community

Discussion on: Practical Rust Web Development - API Rest

Collapse
 
saroar profile image
Saroar Khandoker
impl ProductList {
    pub fn list() -> Self {
        ProductList(result)
    }
}```

 from 

to


```Rust
impl Product {
    pub fn list() -> Self {
        ProductList(result)
    }
}```



then use `Product::list()` look better and don't repeat list two times