Skip to content

Remove generic From conversions#254

Open
demurgos wants to merge 1 commit into
rwf2:masterfrom
demurgos:fix/251-transitive-conversion
Open

Remove generic From conversions#254
demurgos wants to merge 1 commit into
rwf2:masterfrom
demurgos:fix/251-transitive-conversion

Conversation

@demurgos

Copy link
Copy Markdown

This commit removes generic From conversions. Generic conversions are a source of non-local errors caused by ambiguous trait resolution. It is better to ask users to provide more context rather than implementing generic conversions.

Note that this issue does not apply to regular constructors. The Cookie::new method can remain generic without problems.

This commit adds implementations for all pairs of &str, Cow<'_, str>, and String for Cookie. This mirrors the implementations for name-only construction.

For Expiration, conversions are provided for Option<OffsetDateTime> and OffsetDateTime.

Closes #251

This commit removes generic `From` conversions. Generic conversions are a source of non-local errors caused by ambiguous trait resolution. It is better to ask users to provide more context rather than implementing generic conversions.

Note that this issue does not apply to regular constructors. The `Cookie::new` method can remain generic without problems.

This commit adds implementations for all pairs of `&str`, `Cow<'_, str>`, and `String` for `Cookie`. This mirrors the implementations for name-only construction.

For `Expiration`, conversions are provided for `Option<OffsetDateTime>` and `OffsetDateTime`.

Closes rwf2#251
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transitive conversion is a source of non-local build errors

1 participant