Skip to main content

Timeline for Circular FIFO Buffer

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Jan 8, 2019 at 12:53 vote accept RubberDuck
Jan 7, 2019 at 13:45 comment added hellow Quoting Matthieu: "There's no introspection in Rust, you can't try to invoke a constructor with no parameter and hope it works in generic code: a trait MUST describe the available functionality. Using Default is the way to ensure that whoever wishes to use the struct where Default is required will be able to without wrapping it."
Jan 7, 2019 at 13:40 comment added hellow It's getting even more fancy if you do something like this
Jan 7, 2019 at 13:35 comment added hellow Some traits or methods require Default, e.g. Vec::resize_default, which is a more convenient way of resize.
Jan 7, 2019 at 13:20 comment added RubberDuck Nice review! I think I might actually implement a custom error type instead of the enum. Would you mind explaining the benefit of implementing Default for the struct? I think I understand what it does, but don't quite see how that helps me in this particular case.
Jan 7, 2019 at 13:14 history answered hellow CC BY-SA 4.0