Mercurial > hg
comparison rust/rhg/src/error.rs @ 46499:eace48b4a786
rust: Use the DisplayBytes trait in config printing
This is similar to `std::fmt::Display`, but for arbitrary bytes instead
of Unicode. Writing to an abstract output stream helps avoid allocating
intermediate `Vec<u8>` buffers.
Differential Revision: https://phab.mercurial-scm.org/D9966
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 08 Feb 2021 11:13:56 +0100 |
parents | d7685105e504 |
children | d8730ff51d5a |
comparison
equal
deleted
inserted
replaced
46498:3caa3698335e | 46499:eace48b4a786 |
---|---|
88 Vec::new() | 88 Vec::new() |
89 }; | 89 }; |
90 CommandError::Abort { | 90 CommandError::Abort { |
91 message: format_bytes!( | 91 message: format_bytes!( |
92 b"config parse error in {}{}: '{}'", | 92 b"config parse error in {}{}: '{}'", |
93 origin.to_bytes(), | 93 origin, |
94 line_message, | 94 line_message, |
95 bytes | 95 bytes |
96 ), | 96 ), |
97 } | 97 } |
98 } | 98 } |