Skip to content

Instantly share code, notes, and snippets.

#![feature(coroutines, coroutine_trait)]
use snafu::prelude::*;
use std::{
ops::{Coroutine, CoroutineState},
pin::pin,
str,
};
#[derive(Debug, Copy, Clone)]
//! This crate provides types for UCD’s `Blocks.txt`.
pub struct Blocks {
ranges: Vec<(RangeInclusive<u32>, String)>,
}
impl Blocks {
pub fn block_of(&self, c: char) -> &str {
self.ranges
.binary_search_by(|(range, _)| {
#[derive(Debug, Snafu)]
#[snafu(module)]
enum Error { Alpha }

By default, should that generate

mod error {
@shepmaster
shepmaster / playground.rs
Created January 19, 2020 04:13
Code shared from the Rust Playground
// This code was saved by an automated test for the Rust Playground
@shepmaster
shepmaster / playground.rs
Created January 19, 2020 02:49
Code shared from the Rust Playground
// This code was saved by an automated test for the Rust Playground
@shepmaster
shepmaster / playground.rs
Created January 18, 2020 19:04
Code shared from the Rust Playground
// This code was saved by an automated test for the Rust Playground
@shepmaster
shepmaster / playground.rs
Created January 18, 2020 18:44
Code shared from the Rust Playground
// This code was saved by an automated test for the Rust Playground
@shepmaster
shepmaster / playground.rs
Created December 19, 2019 04:21
Code shared from the Rust Playground
// This code was saved by an automated test for the Rust Playground
@shepmaster
shepmaster / playground.rs
Created December 14, 2019 15:21
Code shared from the Rust Playground
// This code was saved by an automated test for the Rust Playground
@shepmaster
shepmaster / playground.rs
Created December 13, 2019 19:08
Code shared from the Rust Playground
// This code was saved by an automated test for the Rust Playground