This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "tokio-serde-json-ipc" | |
version = "0.0.0" | |
edition = "2018" | |
publish = false | |
[dependencies] | |
futures = "0.1" | |
serde_json = "1" | |
tokio = "0.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "hyper-h2" | |
version = "0.0.0" | |
edition = "2018" | |
publish = false | |
[dependencies] | |
ct-logs = "0.6" | |
hyper = "0.12" | |
hyper-rustls = "0.17" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro_rules! switch { | |
(($target:expr) { $($inner:tt)* }) => { | |
switch! { @match ($target) { $($inner)* } {} } | |
}; | |
(@match ($target:expr) { $pat:pat => $blk:expr, $($rest:tt)* } { $($buf:tt)* }) => { | |
switch! { @match ($target) { $($rest)* } { | |
$($buf)* | |
$pat => switch! { @fall $blk; $($rest)* }, | |
}} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(min_const_generics)] | |
use std::mem::{self, MaybeUninit}; | |
use std::ptr; | |
pub fn array_default<T: Default, const N: usize>() -> [T; N] { | |
struct Guard<T> { | |
dst: *mut T, | |
i: usize, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fmt::{self, Formatter}; | |
use std::marker::PhantomData; | |
use serde::{de, Deserialize}; | |
#[cfg(test)] | |
mod tests { | |
use super::*; | |
#[derive(Debug, Deserialize)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(arbitrary_self_types)] | |
use std::marker::{PhantomPinned, Unpin}; | |
use std::ops::{Deref, DerefMut}; | |
use std::pin::Pin; | |
use pin_project_lite::pin_project; | |
#[derive(Copy, Clone)] | |
pub enum MaybePin<P> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro_rules! pin_project_cfg { | |
($(#[$($attr:tt)*])* $vis:vis enum $($rest:tt)+) => { | |
pin_project_cfg! { | |
@outer [$(#[$($attr)*])* $vis enum] $($rest)+ | |
} | |
}; | |
// Accumulate type parameters and `where` clause. | |
(@outer [$($accum:tt)*] $tt:tt $($rest:tt)+) => { | |
pin_project_cfg! { | |
@outer [$($accum)* $tt] $($rest)+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(type_alias_impl_trait)] | |
use std::error; | |
use std::io; | |
use futures_core::TryFuture; | |
use futures_util::future::{MapErr, TryFutureExt}; | |
#[allow(type_alias_bounds)] // The bound seems not to be removable. | |
pub type IoFuture<F: TryFuture> = MapErr<F, impl Fn(<F as TryFuture>::Error) -> io::Error>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cmp::Ordering; | |
use std::fmt::{self, Display, Write}; | |
struct FmtCmp<T>(T); | |
impl<T: Display> PartialEq for FmtCmp<T> { | |
fn eq(&self, other: &Self) -> bool { | |
self.cmp(other) == Ordering::Equal | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![cfg_attr(test, feature(test))] | |
#![cfg_attr(feature = "int_log", feature(int_log))] | |
use std::cmp::Ordering; | |
macro_rules! imp { | |
($lhs:expr, $rhs:expr, |$min:ident, $max:ident| $divisor:expr) => {{ | |
// Because `'0' < '9' < 'A' < 'Z' (< 'a' < 'z')` holds, we don't need to special-case | |
// radixes greater than 10. |