Move byte formatting macro to macro module

This commit is contained in:
Tobie Morgan Hitchcock 2022-02-17 08:05:25 +00:00
parent 10a76ec3a1
commit 691d6ac895
2 changed files with 6 additions and 7 deletions

View file

@ -2,15 +2,8 @@ use crate::dbs::Executor;
use crate::dbs::Options; use crate::dbs::Options;
use crate::dbs::Runtime; use crate::dbs::Runtime;
use crate::err::Error; use crate::err::Error;
use bytes::Bytes;
use hyper::body::Sender; use hyper::body::Sender;
macro_rules! output {
($expression:expr) => {
Bytes::from(format!("{}\n", $expression))
};
}
impl Executor { impl Executor {
pub async fn export( pub async fn export(
&mut self, &mut self,

View file

@ -1,3 +1,9 @@
macro_rules! output {
($expression:expr) => {
bytes::Bytes::from(format!("{}\n", $expression))
};
}
macro_rules! map { macro_rules! map {
($($k:expr => $v:expr),* $(,)?) => {{ ($($k:expr => $v:expr),* $(,)?) => {{
let mut m = ::std::collections::BTreeMap::new(); let mut m = ::std::collections::BTreeMap::new();