Skip to content

What trait bounds are appropriate for stubs? #631

@petertseng

Description

@petertseng

As we add stubs, we should ask what trait bounds are appropriate.

Decision made in #497 (simple-linked-list c5f7a43): Not to add Debug.

Should Debug remain in custom-set? #605 (comment)

Not to put Debug in circular-buffer: #608 (comment)

Discussion in sublist: Be minimally restrictive: #610 (comment)

Summary: I think we are indeed trying to be consistent about being minimally restrictive. Please chime in if you think we should do differently, or for any further input on the topic.

Current trait bounds (the grep pattern may not be the best, feel free to suggest a better)

$ git grep '<[^>]:.*>' exercises/*/src/lib.rs 
exercises/custom-set/src/lib.rs:impl<T: Debug> CustomSet<T> {
exercises/react/src/lib.rs:impl<T: Copy + PartialEq> Reactor<T> {
exercises/react/src/lib.rs:    pub fn create_compute<F: Fn(&[T]) -> T>(
exercises/react/src/lib.rs:    pub fn add_callback<F: FnMut(T) -> ()>(
exercises/simple-linked-list/src/lib.rs:impl<T: Clone> SimpleLinkedList<T> {
exercises/simple-linked-list/src/lib.rs:impl<'a, T: Clone> From<&'a [T]> for SimpleLinkedList<T> {

If there is no further input, I think the way to close this issue is to remove Debug from custom-set. You will then need to remove references to variables in unimplemented! messages, so will have to replace them with underscored names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR addressingA PR exists addressing this issuetrack policyOfficial pronouncements about What We Do Here

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions