This file contains 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
import AppKit | |
/* | |
* A command to address issues when transferring bulleted lists from Notion to Slack, | |
* where nested bullet points do not maintain their structure correctly. | |
* Examples of bullet hierarchy: | |
* - one | |
* - two | |
* - three | |
* |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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; | |
#[derive(Debug)] | |
pub struct List<T: Eq> { | |
head: Option<Box<Node<T>>>, | |
} | |
#[derive(Debug)] | |
pub struct Node<T> { | |
value: T, | |
next: Option<Box<Node<T>>>, | |
} |
This file contains 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
#[derive(Debug)] | |
pub struct RBTree<K, V> | |
where | |
K: Ord, | |
{ | |
root: Option<Box<Node<K, V>>>, | |
should_change: bool, | |
} | |
#[derive(PartialEq, Debug)] | |
enum Color { |
This file contains 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::io::*; | |
use std::str::*; | |
fn read<T: FromStr>(s: &mut StdinLock) -> Option<T> { | |
let s = s.by_ref().bytes().map(|c| c.unwrap() as char) | |
.skip_while(|c| c.is_whitespace()) | |
.take_while(|c| !c.is_whitespace()) | |
.collect::<String>(); | |
s.parse::<T>().ok() | |
} |