Skip to content

Commit 88114b8

Browse files
committed
Relax trait bounds to match the rest of the stdlib (by allowing useless construction)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
1 parent 2c224d5 commit 88114b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/std/src/io/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1856,13 +1856,13 @@ pub trait Write {
18561856
/// }
18571857
/// ```
18581858
#[unstable(feature = "impl_fmt_write_for_io_write", issue = "77733")]
1859-
pub struct FmtWriteAdapter<'a, W: Write + ?Sized> {
1859+
pub struct FmtWriteAdapter<'a, W: ?Sized> {
18601860
inner: &'a mut W,
18611861
error: Option<Error>,
18621862
}
18631863

18641864
#[unstable(feature = "impl_fmt_write_for_io_write", issue = "77733")]
1865-
impl<W: Write + ?Sized> FmtWriteAdapter<'_, W> {
1865+
impl<W> FmtWriteAdapter<'_, W> {
18661866
/// Returns a reference to the last error that occurred in this adapter.
18671867
pub fn err(&self) -> &Option<Error> {
18681868
&self.error
@@ -1875,7 +1875,7 @@ impl<W: Write + ?Sized> FmtWriteAdapter<'_, W> {
18751875
}
18761876

18771877
#[unstable(feature = "impl_fmt_write_for_io_write", issue = "77733")]
1878-
impl<W: Write + ?Sized> fmt::Write for FmtWriteAdapter<'_, W> {
1878+
impl<W: Write> fmt::Write for FmtWriteAdapter<'_, W> {
18791879
fn write_str(&mut self, s: &str) -> fmt::Result {
18801880
match self.inner.write_all(s.as_bytes()) {
18811881
Ok(()) => {
@@ -1891,7 +1891,7 @@ impl<W: Write + ?Sized> fmt::Write for FmtWriteAdapter<'_, W> {
18911891
}
18921892

18931893
#[unstable(feature = "impl_fmt_write_for_io_write", issue = "77733")]
1894-
impl<W: Write + ?Sized> Debug for FmtWriteAdapter<'_, W> {
1894+
impl<W> Debug for FmtWriteAdapter<'_, W> {
18951895
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18961896
let mut builder = f.debug_struct("FmtWriteAdapter");
18971897
builder.field("error", &self.error);

0 commit comments

Comments
 (0)