Skip to content

Commit 07c8e8e

Browse files
committed
fix: impl<'a> From<AsciiString> for Cow<'a, AsciiStr>
Fixes tomprogrammer#110 Modify the implementation of `From<AsciiString>` for `Cow<'a, AsciiStr>`. * Change `impl From<AsciiString> for Cow<'static, AsciiStr>` to `impl<'a> From<AsciiString> for Cow<'a, AsciiStr>` in `src/ascii_string.rs` * Broaden the conversion abilities by making it generic over any lifetime `'a` --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/tomprogrammer/rust-ascii/issues/110?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 888dfce commit 07c8e8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ascii_string.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,8 @@ impl<'a> From<Cow<'a, AsciiStr>> for AsciiString {
579579
}
580580
}
581581

582-
impl From<AsciiString> for Cow<'static, AsciiStr> {
583-
fn from(string: AsciiString) -> Cow<'static, AsciiStr> {
582+
impl<'a> From<AsciiString> for Cow<'a, AsciiStr> {
583+
fn from(string: AsciiString) -> Cow<'a, AsciiStr> {
584584
Cow::Owned(string)
585585
}
586586
}

0 commit comments

Comments
 (0)