I hereby claim:
- I am xfix on github.
- I am borowski (https://keybase.io/borowski) on keybase.
- I have a public key whose fingerprint is E540 2FAF 20B4 39B7 ED35 8774 710B B848 FE46 266F
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#include <iostream> | |
#include <string> | |
#include <variant> | |
int main() { | |
std::variant<std::string, int, bool> foo = "Hello, world!"; | |
std::visit([](auto arg) { | |
std::cout << arg; | |
}, foo); | |
} |
use std::env; | |
use std::fs::File; | |
use std::ffi::OsStr; | |
use std::io::{self, Read, StdoutLock, Write}; | |
fn copy_name<R, W>(mut stdin: R, name: &OsStr, mut stdout: W) -> io::Result<()> | |
where | |
R: Read, | |
W: Write, | |
{ |
#![feature(libc)] | |
extern crate libc; | |
use libc::{c_char, size_t}; | |
use std::mem::align_of; | |
use std::{i8, u8, usize}; | |
fn has_zero(x: usize) -> bool { |
use std::borrow::Cow; | |
use std::env::ArgsOs; | |
use std::io::{self, Write}; | |
use std::os::unix::ffi::OsStringExt; | |
const BUFFER_SIZE: usize = 32 * 1024; | |
fn fill_buffer<'a>(buffer: &'a mut [u8], text: &'a [u8]) -> &'a [u8] { | |
let half_buffer_len = buffer.len() / 2; |
#![feature(alloc, heap_api, unique, untagged_unions)] | |
extern crate alloc; | |
use alloc::heap::{allocate, deallocate}; | |
use std::ops::Deref; | |
use std::ptr::{self, Unique}; | |
use std::slice; | |
use std::str; |
<!DOCTYPE html> | |
<style> | |
html { | |
height: 100%; | |
} | |
body { | |
min-height: 100%; | |
display: flex; | |
flex-direction: column; | |
margin: 0; |
fn is_palindrome<'a, I: ?Sized>(iter: &'a I) -> bool | |
where &'a I: IntoIterator, | |
<&'a I as IntoIterator>::Item: PartialEq, | |
<&'a I as IntoIterator>::IntoIter: DoubleEndedIterator | |
{ | |
iter.into_iter().eq(iter.into_iter().rev()) | |
} |
pub mod some_object { | |
pub struct Something; | |
mod method_implementation { | |
use some_object::Something; | |
pub trait MethodImplementation<T> { | |
fn method(&self, value: T); | |
} |
use std::error::Error; | |
use std::fmt::{self, Display}; | |
use std::io::{self, BufRead, Write}; | |
use std::num::ParseFloatError; | |
#[derive(Debug)] | |
enum ParseError { | |
IoError(io::Error), | |
FloatError(ParseFloatError), | |
} |