- Start Date: 2014-09-30
- RFC PR: (leave this empty)
- Rust Issue: (leave this empty)
Features:
- A sugar for structs with optional arguments
- A sugar for declaring all members of a struct public
rustc examples/draw_state_test.rs | |
--crate-name draw_state_test | |
--crate-type bin | |
-g | |
--out-dir /Users/sven/rust/gfx_graphics/target/debug/examples | |
--emit=dep-info,link | |
-L dependency=/Users/sven/rust/gfx_graphics/target/debug | |
-L dependency=/Users/sven/rust/gfx_graphics/target/debug/deps | |
--extern graphics=/Users/sven/rust/gfx_graphics/target/debug/deps/libgraphics-3ec65f4f2805722e.rlib | |
--extern image=/Users/sven/rust/gfx_graphics/target/debug/deps/libimage-85c07ef1cf5314da.rlib |
impl<'a> ToIndex<usize, &'a [usize]> for Permutation<Data> { | |
fn to_index(&self, dim: usize, pos: &'a [usize]) -> usize { | |
let mut index = 0; | |
let mut count = self.count(dim); | |
for (i, &x) in pos.iter().enumerate() { | |
count /= dim - i; | |
let lower = pos[..i].iter().fold(0, |a, &y| | |
if y < x { a + 1 } else { a }); | |
index += count * (x - lower); | |
} |
#!/bin/bash | |
#written by zzmp | |
# This script will recompile a rust project using `cargo build` | |
# every time something in the specified directory changes. | |
# Watch files in infinite loop | |
watch () { | |
UNAME=$(uname) |
current! { | |
FOO: bar | |
=> { | |
print_text(); | |
print_text(); | |
} | |
} |
#![feature(globs)] | |
#![feature(if_let)] | |
extern crate piston; | |
extern crate gfx; | |
mod snakeapp; | |
mod object; | |
mod settings; | |
mod text; |
/// Calls closure with a texture constructor enabled. | |
/// This is required to render characters. | |
pub fn with_texture_constructor<'a>(&mut self, texture_constructor: TextureConstructor<'a, T>, f: |&mut UiContext<T>|) { | |
use std::mem::transmute; | |
self.glyph_cache.texture_constructor = | |
Some(unsafe { transmute(texture_constructor) }); | |
f(self); | |
self.glyph_cache.texture_constructor = None; | |
} |
Failed to run custom build command for `cocoa v0.1.0 (https://github.com/DavidPartouche/rust-cocoa#b9cbbd50)` | |
Process didn't exit successfully: `make -f makefile.msgsend` (status=2) | |
--- stdout | |
cc -Wall src/msgsend.m -o /Users/sven/rust/glutin/target/native/cocoa-ebcc268ffcd672e2/msgsend.o -c | |
--- stderr | |
src/msgsend.m:82:9: warning: incompatible pointer to integer conversion returning 'id' from a function with result type 'char' [-Wint-conversion] | |
return objc_msgSend(theReceiver, theSelector, a); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
src/msgsend.m:86:15: warning: incompatible pointer types initializing 'NSPoint (*)(id, SEL, NSPoint)' with an expression of type 'NSPoint *' (aka 'struct CGPoint *') [-Wincompatible-pointer-types] |
.text | |
.file "rust-out.0.rs" | |
.section .rodata.cst16,"aM",@progbits,16 | |
.align 16 | |
.LCPI0_0: | |
.quad 4607182418800017408 | |
.quad 4607182418800017408 | |
.section .text._ZN4main20h03e1bf4befed0cc7eaaE,"ax",@progbits | |
.align 16, 0x90 | |
.type _ZN4main20h03e1bf4befed0cc7eaaE,@function |
#[deriving(Show)] | |
pub struct Stuff<'a> { | |
pub desc: &'a str, | |
pub owner: Option<&'a str>, | |
// pub borrower: Option<&'a str>, | |
pub using: Option<&'a str>, | |
pub key_to: Option<&'a str>, | |
// pub left_hand: Option<&'a str>, | |
// pub right_hand: Option<&'a str>, | |
// pub mother: Option<&'a str>, |