chore: bump to newer nightly (#1426)

This commit is contained in:
Taiki Endo
2019-08-11 02:01:20 +09:00
committed by GitHub
parent fff39c03b1
commit d9f9c5658f
44 changed files with 45 additions and 89 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ task:
- pkg install -y curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
# TODO: switch back to nightly
- sh rustup.sh -y --default-toolchain nightly-2019-07-17
- sh rustup.sh -y --default-toolchain nightly-2019-08-10
- . $HOME/.cargo/env
- rustup target add i686-unknown-freebsd
- |
+1 -1
View File
@@ -2,7 +2,7 @@ trigger: ["master", "std-future"]
pr: ["master", "std-future"]
variables:
nightly: nightly-2019-07-17
nightly: nightly-2019-08-10
RUSTFLAGS: -Dwarnings
jobs:
-2
View File
@@ -27,8 +27,6 @@ steps:
# All platforms.
- script: |
rustup toolchain install nightly
rustup update
rustup toolchain list
rustc -Vv
cargo -V
+1 -1
View File
@@ -1 +1 @@
nightly-2019-07-17
nightly-2019-08-10
+1 -4
View File
@@ -234,10 +234,7 @@ impl<T: AsyncRead + Unpin, U: Unpin> AsyncRead for Fuse<T, U> {
}
impl<T: AsyncBufRead + Unpin, U: Unpin> AsyncBufRead for Fuse<T, U> {
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
pin!(self.get_mut().0).poll_fill_buf(cx)
}
+1 -4
View File
@@ -280,10 +280,7 @@ impl<T: AsyncRead + Unpin> AsyncRead for FramedWrite2<T> {
}
impl<T: AsyncBufRead + Unpin> AsyncBufRead for FramedWrite2<T> {
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
pin!(self.get_mut().inner).poll_fill_buf(cx)
}
+1 -1
View File
@@ -284,7 +284,7 @@ impl AsyncRead for Mock {
// TODO this newtype is necessary because `&[u8]` does not currently implement `AsyncRead`
struct Slice<'a>(&'a [u8]);
impl<'a> AsyncRead for Slice<'a> {
impl AsyncRead for Slice<'_> {
fn poll_read(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
+5 -5
View File
@@ -429,7 +429,7 @@ impl<P: Park + Default> Default for CurrentThread<P> {
// ===== impl Entered =====
impl<'a, P: Park> Entered<'a, P> {
impl<P: Park> Entered<'_, P> {
/// Spawn the future on the executor.
///
/// This internally queues the future to be executed once `run` is called.
@@ -593,7 +593,7 @@ impl<'a, P: Park> Entered<'a, P> {
}
}
impl<'a, P: Park> fmt::Debug for Entered<'a, P> {
impl<P: Park> fmt::Debug for Entered<'_, P> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("Entered")
.field("executor", &self.executor)
@@ -738,7 +738,7 @@ where
// ===== impl Borrow =====
impl<'a, U: Unpark> Borrow<'a, U> {
impl<U: Unpark> Borrow<'_, U> {
fn enter<F, R>(&mut self, f: F) -> R
where
F: FnOnce() -> R,
@@ -750,7 +750,7 @@ impl<'a, U: Unpark> Borrow<'a, U> {
}
}
impl<'a, U: Unpark> SpawnLocal for Borrow<'a, U> {
impl<U: Unpark> SpawnLocal for Borrow<'_, U> {
fn spawn_local(&mut self, future: Pin<Box<dyn Future<Output = ()>>>, already_counted: bool) {
if !already_counted {
// NOTE: we have a borrow of the Runtime, so we know that it isn't shut down.
@@ -770,7 +770,7 @@ impl CurrentRunner {
{
struct Reset<'a>(&'a CurrentRunner);
impl<'a> Drop for Reset<'a> {
impl Drop for Reset<'_> {
fn drop(&mut self) {
self.0.spawn.set(None);
self.0.id.set(None);
+2 -2
View File
@@ -253,7 +253,7 @@ where
node: Option<Arc<Node<U>>>,
}
impl<'a, U: Unpark> Drop for Bomb<'a, U> {
impl<U: Unpark> Drop for Bomb<'_, U> {
fn drop(&mut self) {
if let Some(node) = self.node.take() {
self.borrow.enter(|| release_node(node))
@@ -329,7 +329,7 @@ where
}
}
impl<'a, U: Unpark> Scheduled<'a, U> {
impl<U: Unpark> Scheduled<'_, U> {
/// Polls the task, returns `true` if the task has completed.
pub fn tick(&mut self) -> bool {
let waker = unsafe {
@@ -380,7 +380,6 @@ mod and_turn {
},
);
}
}
mod in_drop {
@@ -441,7 +440,6 @@ mod in_drop {
},
);
}
}
/*
+1 -1
View File
@@ -153,7 +153,7 @@ where
// when leaving the scope. This handles cases that involve panicking.
struct Reset<'a>(&'a Cell<State>, State);
impl<'a> Drop for Reset<'a> {
impl Drop for Reset<'_> {
fn drop(&mut self) {
self.0.set(self.1);
}
+1 -1
View File
@@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)]
#![feature(await_macro, async_await)]
#![feature(async_await)]
#[test]
fn block_on_ready() {
+1 -1
View File
@@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)]
#![feature(await_macro, async_await)]
#![feature(async_await)]
use tokio_executor::{self, DefaultExecutor};
-7
View File
@@ -184,7 +184,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
asyncify(|| self.std.seek(pos)).await
}
@@ -209,7 +208,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn sync_all(&mut self) -> io::Result<()> {
asyncify(|| self.std.sync_all()).await
}
@@ -238,7 +236,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn sync_data(&mut self) -> io::Result<()> {
asyncify(|| self.std.sync_data()).await
}
@@ -270,7 +267,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn set_len(&mut self, size: u64) -> io::Result<()> {
asyncify(|| self.std.set_len(size)).await
}
@@ -292,7 +288,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn metadata(&self) -> io::Result<Metadata> {
asyncify(|| self.std.metadata()).await
}
@@ -314,7 +309,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn try_clone(&self) -> io::Result<File> {
let std_file = asyncify(|| self.std.try_clone()).await?;
Ok(File::from_std(std_file))
@@ -351,7 +345,6 @@ impl File {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn set_permissions(&self, perm: Permissions) -> io::Result<()> {
asyncify(|| self.std.set_permissions(perm)).await
}
-1
View File
@@ -89,7 +89,6 @@ impl OpenOptions {
/// Tokio runtime or if the underlying [`open`] call results in an error.
///
/// [`open`]: https://doc.rust-lang.org/std/fs/struct.OpenOptions.html#method.open
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn open<P>(&self, path: P) -> io::Result<File>
where
P: AsRef<Path> + Send + Unpin + 'static,
-2
View File
@@ -182,7 +182,6 @@ impl DirEntry {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn metadata(&self) -> io::Result<Metadata> {
asyncify(|| self.0.metadata()).await
}
@@ -222,7 +221,6 @@ impl DirEntry {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn file_type(&self) -> io::Result<FileType> {
asyncify(|| self.0.file_type()).await
}
+6 -18
View File
@@ -31,10 +31,7 @@ pub trait AsyncBufRead: AsyncRead {
///
/// [`poll_read`]: AsyncRead::poll_read
/// [`consume`]: AsyncBufRead::consume
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>>;
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>>;
/// Tells this buffer that `amt` bytes have been consumed from the buffer,
/// so they should no longer be returned in calls to [`poll_read`].
@@ -56,8 +53,8 @@ pub trait AsyncBufRead: AsyncRead {
macro_rules! deref_async_buf_read {
() => {
fn poll_fill_buf<'a>(self: Pin<&'a mut Self>, cx: &mut Context<'_>)
-> Poll<io::Result<&'a [u8]>>
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>)
-> Poll<io::Result<&[u8]>>
{
Pin::new(&mut **self.get_mut()).poll_fill_buf(cx)
}
@@ -81,10 +78,7 @@ where
P: DerefMut + Unpin,
P::Target: AsyncBufRead,
{
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
self.get_mut().as_mut().poll_fill_buf(cx)
}
@@ -94,10 +88,7 @@ where
}
impl AsyncBufRead for &[u8] {
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
_cx: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
Poll::Ready(Ok(*self))
}
@@ -107,10 +98,7 @@ impl AsyncBufRead for &[u8] {
}
impl<T: AsRef<[u8]> + Unpin> AsyncBufRead for io::Cursor<T> {
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
_cx: &mut Context<'_>,
) -> Poll<io::Result<&'a [u8]>> {
fn poll_fill_buf(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<&[u8]>> {
Poll::Ready(io::BufRead::fill_buf(self.get_mut()))
}
+1 -1
View File
@@ -33,7 +33,7 @@ where
}
}
impl<'a, R, W> Future for Copy<'a, R, W>
impl<R, W> Future for Copy<'_, R, W>
where
R: AsyncRead + Unpin + ?Sized,
W: AsyncWrite + Unpin + ?Sized,
+1 -1
View File
@@ -22,7 +22,7 @@ where
Flush { a }
}
impl<'a, A> Unpin for Flush<'a, A> where A: Unpin + ?Sized {}
impl<A> Unpin for Flush<'_, A> where A: Unpin + ?Sized {}
impl<A> Future for Flush<'_, A>
where
+1 -1
View File
@@ -29,7 +29,7 @@ pub struct Read<'a, R: ?Sized> {
}
// forward Unpin
impl<'a, R: Unpin + ?Sized> Unpin for Read<'_, R> {}
impl<R: Unpin + ?Sized> Unpin for Read<'_, R> {}
impl<R> Future for Read<'_, R>
where
+1 -1
View File
@@ -40,7 +40,7 @@ fn eof() -> io::Error {
}
// forward Unpin
impl<'a, A: Unpin + ?Sized> Unpin for ReadExact<'_, A> {}
impl<A: Unpin + ?Sized> Unpin for ReadExact<'_, A> {}
impl<A> Future for ReadExact<'_, A>
where
+1 -1
View File
@@ -22,7 +22,7 @@ where
Shutdown { a }
}
impl<'a, A> Unpin for Shutdown<'a, A> where A: Unpin + ?Sized {}
impl<A> Unpin for Shutdown<'_, A> where A: Unpin + ?Sized {}
impl<A> Future for Shutdown<'_, A>
where
+1 -1
View File
@@ -22,7 +22,7 @@ where
}
// forward Unpin
impl<'a, W: Unpin + ?Sized> Unpin for Write<'a, W> {}
impl<W: Unpin + ?Sized> Unpin for Write<'_, W> {}
impl<W> Future for Write<'_, W>
where
+1 -1
View File
@@ -6,7 +6,7 @@ pub(crate) trait Kill {
fn kill(&mut self) -> io::Result<()>;
}
impl<'a, T: 'a + Kill> Kill for &'a mut T {
impl<T: Kill> Kill for &mut T {
fn kill(&mut self) -> io::Result<()> {
(**self).kill()
}
+2 -2
View File
@@ -10,7 +10,7 @@ pub(crate) trait Wait {
fn try_wait(&mut self) -> io::Result<Option<ExitStatus>>;
}
impl<'a, T: 'a + Wait> Wait for &'a mut T {
impl<T: Wait> Wait for &mut T {
fn id(&self) -> u32 {
(**self).id()
}
@@ -29,7 +29,7 @@ pub(crate) trait OrphanQueue<T> {
fn reap_orphans(&self);
}
impl<'a, T, O: 'a + OrphanQueue<T>> OrphanQueue<T> for &'a O {
impl<T, O: OrphanQueue<T>> OrphanQueue<T> for &O {
fn push_orphan(&self, orphan: T) {
(**self).push_orphan(orphan);
}
-1
View File
@@ -35,7 +35,6 @@ mod platform {
println!("received SIGTERM");
}
}
}
#[cfg(not(unix))]
-1
View File
@@ -111,7 +111,6 @@ impl<T> Lock<T> {
}
/// A future that resolves on acquiring the lock and returns the `LockGuard`.
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn lock(&mut self) -> LockGuard<T> {
poll_fn(|cx| self.poll_lock(cx)).await
}
-2
View File
@@ -167,7 +167,6 @@ impl<T> Receiver<T> {
/// assert_eq!(Some("world"), rx.recv().await);
/// }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn recv(&mut self) -> Option<T> {
use futures_util::future::poll_fn;
@@ -244,7 +243,6 @@ impl<T> Sender<T> {
/// }
/// }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn send(&mut self, value: T) -> Result<(), SendError> {
use futures_util::future::poll_fn;
-1
View File
@@ -135,7 +135,6 @@ impl<T> UnboundedReceiver<T> {
/// assert_eq!(Some("world"), rx.recv().await);
/// }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn recv(&mut self) -> Option<T> {
use futures_util::future::poll_fn;
-1
View File
@@ -225,7 +225,6 @@ impl<T> Sender<T> {
/// println!("the receiver dropped");
/// }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn closed(&mut self) {
use futures_util::future::poll_fn;
+1 -1
View File
@@ -306,7 +306,7 @@ impl WakerRef for Waker {
}
}
impl<'a> WakerRef for &'a Waker {
impl WakerRef for &Waker {
fn wake(self) {
self.wake_by_ref()
}
+3 -5
View File
@@ -249,8 +249,7 @@ impl<T> Receiver<T> {
///
/// Only the **most recent** value is returned. If the receiver is falling
/// behind the sender, intermediate values are dropped.
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn recv_ref<'a>(&'a mut self) -> Option<Ref<'a, T>> {
pub async fn recv_ref(&mut self) -> Option<Ref<'_, T>> {
let shared = &self.shared;
let inner = &self.inner;
let version = self.ver;
@@ -296,7 +295,7 @@ impl<T: Clone> Receiver<T> {
///
/// This is equivalent to calling `clone()` on the value returned by
/// `recv()`.
#[allow(clippy::needless_lifetimes, clippy::map_clone)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
#[allow(clippy::map_clone)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3274
pub async fn recv(&mut self) -> Option<T> {
self.recv_ref().await.map(|v_ref| v_ref.clone())
}
@@ -388,7 +387,6 @@ impl<T> Sender<T> {
///
/// This allows the producer to get notified when interest in the produced
/// values is canceled and immediately stop doing work.
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn closed(&mut self) {
poll_fn(|cx| self.poll_close(cx)).await
}
@@ -447,7 +445,7 @@ impl<T> Drop for Sender<T> {
// ===== impl Ref =====
impl<'a, T: 'a> ops::Deref for Ref<'a, T> {
impl<T> ops::Deref for Ref<'_, T> {
type Target = T;
fn deref(&self) -> &T {
+1 -1
View File
@@ -78,7 +78,7 @@ impl<'a> OnClose<'a> {
}
}
impl<'a> Future for OnClose<'a> {
impl Future for OnClose<'_> {
type Output = bool;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<bool> {
-1
View File
@@ -86,7 +86,6 @@ impl TcpListener {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn accept(&mut self) -> io::Result<(TcpStream, SocketAddr)> {
poll_fn(|cx| self.poll_accept(cx)).await
}
+1 -1
View File
@@ -136,7 +136,7 @@ impl tokio_executor::Executor for Sender {
}
}
impl<'a> tokio_executor::Executor for &'a Sender {
impl tokio_executor::Executor for &Sender {
fn status(&self) -> Result<(), tokio_executor::SpawnError> {
let state: pool::State = self.pool.state.load(Acquire).into();
+1 -1
View File
@@ -124,7 +124,7 @@ impl Task {
let res = panic::catch_unwind(panic::AssertUnwindSafe(|| {
struct Guard<'a>(&'a mut Option<BoxFuture>, bool);
impl<'a> Drop for Guard<'a> {
impl Drop for Guard<'_> {
fn drop(&mut self) {
// This drops the future
if self.1 {
+1 -1
View File
@@ -530,7 +530,7 @@ impl Worker {
worker: &'a Worker,
}
impl<'a> Drop for Guard<'a> {
impl Drop for Guard<'_> {
fn drop(&mut self) {
// A task is allocated at run when it was explicitly notified
// that the task has capacity to block. When this happens, that
+1 -1
View File
@@ -350,7 +350,7 @@ fn busy_threadpool_is_not_idle() {
struct IdleFut<'a>(&'a mut Shutdown);
impl<'a> Future for IdleFut<'a> {
impl Future for IdleFut<'_> {
type Output = ();
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
+1 -1
View File
@@ -142,7 +142,7 @@ where
// when leaving the scope. This handles cases that involve panicking.
struct Reset<'a>(&'a Cell<Option<*const Clock>>);
impl<'a> Drop for Reset<'a> {
impl Drop for Reset<'_> {
fn drop(&mut self) {
self.0.set(None);
}
-1
View File
@@ -94,7 +94,6 @@ impl Interval {
/// // approximately 30ms have elapsed.
/// }
/// ```
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
#[allow(clippy::should_implement_trait)] // TODO: rename (tokio-rs/tokio#1261)
pub async fn next(&mut self) -> Option<Instant> {
poll_fn(|cx| self.poll_next(cx)).await
+1 -2
View File
@@ -72,7 +72,7 @@ struct Guard<'a, S>(&'a mut TlsStream<S>)
where
AllowStd<S>: Read + Write;
impl<'a, S> Drop for Guard<'a, S>
impl<S> Drop for Guard<'_, S>
where
AllowStd<S>: Read + Write,
{
@@ -287,7 +287,6 @@ impl TlsAcceptor {
/// This is typically used after a new socket has been accepted from a
/// `TcpListener`. That socket is then passed to this function to perform
/// the server half of accepting a client connection.
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn accept<S>(&self, stream: S) -> Result<TlsStream<S>, Error>
where
S: AsyncRead + AsyncWrite + Unpin,
+1 -1
View File
@@ -101,7 +101,7 @@ impl UdpSocketRecvHalf {
/// will fail if the socket is not connected.
///
/// [`connect`]: super::UdpSocket::connect
pub async fn recv<'a, 'b>(&'a mut self, buf: &'b mut [u8]) -> io::Result<usize> {
pub async fn recv(&mut self, buf: &mut [u8]) -> io::Result<usize> {
poll_fn(|cx| self.0.poll_recv_priv(cx, buf)).await
}
}
-1
View File
@@ -52,7 +52,6 @@ impl UnixListener {
}
/// Accepts a new incoming connection to this listener.
#[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988
pub async fn accept(&mut self) -> io::Result<(UnixStream, SocketAddr)> {
poll_fn(|cx| self.poll_accept(cx)).await
}
+2 -2
View File
@@ -133,7 +133,7 @@ impl Encoder for Http {
// doesn't go through io::Error.
struct BytesWrite<'a>(&'a mut BytesMut);
impl<'a> fmt::Write for BytesWrite<'a> {
impl fmt::Write for BytesWrite<'_> {
fn write_str(&mut self, s: &str) -> fmt::Result {
self.0.extend_from_slice(s.as_bytes());
Ok(())
@@ -289,7 +289,7 @@ mod date {
struct LocalBuffer<'a>(&'a mut LastRenderedNow);
impl<'a> fmt::Write for LocalBuffer<'a> {
impl fmt::Write for LocalBuffer<'_> {
fn write_str(&mut self, s: &str) -> fmt::Result {
let start = self.0.amt;
let end = start + s.len();