commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
d60e6753b2b23b3b4ff787b505da56cfad0335c9
build.rs
build.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #![feature(io, os)] use std::old_io::process::{Command, ProcessExit, StdioContainer}; use std::os; fn main() { ...
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use std::process::Command; use std::env; fn main() { assert!(Command::new("make") .args(&["-f", "mak...
Upgrade to rustc 1.0.0-dev (47551b574 2015-04-14) (built 2015-03-18)
Upgrade to rustc 1.0.0-dev (47551b574 2015-04-14) (built 2015-03-18)
Rust
bsd-3-clause
larsbergstrom/skia,vvuk/skia,vvuk/skia,akiss77/skia,larsbergstrom/skia,akiss77/skia,akiss77/skia,nox/skia,larsbergstrom/skia,larsbergstrom/skia,nox/skia,akiss77/skia,mmatyas/skia,vvuk/skia,mmatyas/skia,mmatyas/skia,mmatyas/skia,nox/skia,nox/skia,nox/skia,mmatyas/skia,akiss77/skia,akiss77/skia,nox/skia,nox/skia,nox/skia...
0b9cd8a468d63ebda3d7955faf92296d1abcdac0
crates/rust-analyzer/src/task_pool.rs
crates/rust-analyzer/src/task_pool.rs
//! A thin wrapper around `ThreadPool` to make sure that we join all things //! properly. use crossbeam_channel::Sender; pub(crate) struct TaskPool<T> { sender: Sender<T>, inner: threadpool::ThreadPool, } impl<T> TaskPool<T> { pub(crate) fn new(sender: Sender<T>) -> TaskPool<T> { TaskPool { sender...
//! A thin wrapper around `ThreadPool` to make sure that we join all things //! properly. use crossbeam_channel::Sender; pub(crate) struct TaskPool<T> { sender: Sender<T>, inner: threadpool::ThreadPool, } impl<T> TaskPool<T> { pub(crate) fn new(sender: Sender<T>) -> TaskPool<T> { const STACK_SIZE:...
Increase worker thread stack and name them
Increase worker thread stack and name them
Rust
apache-2.0
rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer
837875711a8724784e401ee5ef2fecad006a0ca6
src/test/compile-fail/estr-subtyping.rs
src/test/compile-fail/estr-subtyping.rs
fn wants_box(x: @str) { } fn wants_uniq(x: ~str) { } fn wants_three(x: str/3) { } fn has_box(x: @str) { wants_box(x); wants_uniq(x); //~ ERROR str storage differs: expected ~ but found @ wants_three(x); //~ ERROR str storage differs: expected 3 but found @ } fn has_uniq(x: ~str) { wants_box(x); //~ ERROR ...
fn wants_box(x: @str) { } fn wants_uniq(x: ~str) { } fn wants_slice(x: &str) { } fn has_box(x: @str) { wants_box(x); wants_uniq(x); //~ ERROR str storage differs: expected ~ but found @ wants_slice(x); } fn has_uniq(x: ~str) { wants_box(x); //~ ERROR str storage differs: expected @ but found ~ wants_un...
Remove obsolete fixed-length string test
Remove obsolete fixed-length string test
Rust
apache-2.0
vhbit/rust,SiegeLord/rust,michaelballantyne/rust-gpu,kimroen/rust,AerialX/rust-rt-minimal,rohitjoshi/rust,cllns/rust,stepancheg/rust-ide-rust,j16r/rust,sarojaba/rust-doc-korean,pczarn/rust,erickt/rust,Ryman/rust,0x73/rust,dinfuehr/rust,KokaKiwi/rust,aepsil0n/rust,arthurprs/rand,l0kod/rust,rprichard/rust,mdinger/rust,mi...
a19f7126b5452a9185da747b960225863b94f733
yaqb/src/query_builder/update_statement/changeset.rs
yaqb/src/query_builder/update_statement/changeset.rs
use query_builder::{QueryBuilder, BuildQueryResult}; use query_source::QuerySource; pub trait AsChangeset { type Changeset: Changeset; fn as_changeset(self) -> Self::Changeset; } pub trait Changeset { type Target: QuerySource; fn to_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult; } impl<T> ...
use query_builder::{QueryBuilder, BuildQueryResult}; use query_source::QuerySource; pub trait AsChangeset { type Changeset: Changeset; fn as_changeset(self) -> Self::Changeset; } pub trait Changeset { type Target: QuerySource; fn to_sql(&self, out: &mut QueryBuilder) -> BuildQueryResult; } impl<T> ...
Implement `Changeset` for `Vec<T>` and `Box<T>`
Implement `Changeset` for `Vec<T>` and `Box<T>` A valid use case has arisen in #26 that is impossible to work around at the moment. We're going to eventually add a standard API to handle this, so this implementation has no tests. It will get tested through that API, once we've figured out what the API will look like. ...
Rust
apache-2.0
diesel-rs/diesel,mcasper/diesel,diesel-rs/diesel,SoftwareWarlock/diesel,sgrif/diesel,SoftwareWarlock/diesel,sgrif/diesel,tohou/diesel,mcasper/diesel,tohou/diesel,cascalheira/diesel,cascalheira/diesel
1e12385bea7441659e7d3b0717e9301221ca8354
src/lib.rs
src/lib.rs
//! An implementation of [FLAC](https://xiph.org/flac), free lossless audio //! codec, written in Rust. //! //! # Examples //! //! Basic decoding from a file. //! //! ``` //! use flac::{Stream, ReadStream}; //! use std::fs::File; //! //! match Stream::<ReadStream<File>>::from_file("path/to/file.flac") { //! Ok(mut st...
//! An implementation of [FLAC](https://xiph.org/flac), free lossless audio //! codec, written in Rust. //! //! The code is available on [GitHub](https://github.com/sourrust/flac). //! //! # Examples //! //! Basic decoding from a file. //! //! ``` //! use flac::{Stream, ReadStream}; //! use std::fs::File; //! //! match...
Add GitHub link within the documentation
Add GitHub link within the documentation
Rust
bsd-3-clause
sourrust/flac
6f9ec0615c29a6c7b45bc0db675ce99d90d61eab
src/test/compile-fail/issue-22560.rs
src/test/compile-fail/issue-22560.rs
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Add `ignore-tidy-linelength` and fix formatting
Add `ignore-tidy-linelength` and fix formatting
Rust
apache-2.0
robertg/rust,omasanori/rust,KokaKiwi/rust,andars/rust,XMPPwocky/rust,victorvde/rust,miniupnp/rust,nwin/rust,seanrivera/rust,XMPPwocky/rust,gifnksm/rust,andars/rust,l0kod/rust,aidancully/rust,dwillmer/rust,sae-bom/rust,zachwick/rust,victorvde/rust,ejjeong/rust,zubron/rust,mdinger/rust,mdinger/rust,cllns/rust,gifnksm/rus...
ccfecfaefe286ea5b3663b0d1e5db88d3b237c3b
src/fuzzy/mod.rs
src/fuzzy/mod.rs
mod score; pub mod consts; pub use self::score::*; /// Compares two characters case-insensitively /// /// # Examples /// /// ``` /// assert!(rff::fuzzy::eq('a', 'A')); /// ``` pub fn eq(a: char, b: char) -> bool { a.to_uppercase().eq(b.to_uppercase()) } #[cfg(test)] mod tests { use super::*; use test::Be...
mod score; pub mod consts; use std::ascii::AsciiExt; pub use self::score::*; /// Compares two characters case-insensitively /// /// # Examples /// /// ``` /// assert!(rff::fuzzy::eq('a', 'A')); /// ``` pub fn eq(a: char, b: char) -> bool { match a { a if a == b => true, a if a.is_ascii() && !b.is_...
Optimize fuzzy::eq(), add mixed benchmark
Optimize fuzzy::eq(), add mixed benchmark Checking for direct equality and ascii characters _significantly_ improves the performance of this method for anything that isn't UTF8.
Rust
mit
stewart/rff,stewart/rff
531d106de01c7837703b78709899bf8e92e34d1f
src/search_command.rs
src/search_command.rs
extern crate alfred; use config::Config; use jira_api::SearchIssue; use jira_client; use search_response::SearchResponse; struct SearchCommand { pub config: Config, } impl SearchCommand { pub fn run(&self, keyword: &String) -> Result<String, String> { let jira_search = SearchIssue{ config...
extern crate alfred; use config::Config; use jira_api::SearchIssue; use jira_client; use search_response::SearchResponse; use std::io::{self, Write}; pub struct SearchCommand { pub config: Config, } impl SearchCommand { pub fn run(&self, keyword: &String) -> Result<(), String> { let jira_search = Sea...
Make possible to write alfred items
:art: Make possible to write alfred items
Rust
mit
dorayakikun/alfred_jira_workflow
40a387c4bd9f4d0e3e6875001d69d456f554a9ca
tests/testsuite/cargo_remove/offline/mod.rs
tests/testsuite/cargo_remove/offline/mod.rs
use cargo_test_support::compare::assert_ui; use cargo_test_support::curr_dir; use cargo_test_support::CargoCommand; use cargo_test_support::Project; use cargo_test_support::TestEnv; use crate::cargo_remove::init_registry; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(curr_dir...
use cargo_test_support::compare::assert_ui; use cargo_test_support::curr_dir; use cargo_test_support::CargoCommand; use cargo_test_support::Project; use crate::cargo_remove::init_registry; #[cargo_test] fn case() { init_registry(); let project = Project::from_template(curr_dir!().join("in")); let project_...
Use correct version of cargo in test
Use correct version of cargo in test
Rust
apache-2.0
rust-lang/cargo,rust-lang/cargo,eminence/cargo,rustyhorde/cargo,eminence/cargo,eminence/cargo,eminence/cargo,rust-lang/cargo,rustyhorde/cargo,rust-lang/cargo,rustyhorde/cargo,rustyhorde/cargo
ccc0f3014aa514803a27c1bde25b54c165c1ae87
src/net/conn/defs.rs
src/net/conn/defs.rs
//! Definition of various types related to connexions /// Type of the ether_type pub type EtherType = u16; /// Type that represent a protocol id pub type ProtocolIdType = u8; /// Type that represent a port pub type PortType = u16;
//! Definition of various types related to connexions use net::defs::{HwAddr, IpAddr}; /// Type of the ether_type pub type EtherType = u16; /// Type that represent a protocol id pub type ProtocolIdType = u8; /// Type that represent a port pub type PortType = u16; /// Ethernet layer part of the rule pub struct Ethern...
Add type EthernetRule, NetworkRule and TransportRule
net/conn: Add type EthernetRule, NetworkRule and TransportRule
Rust
mit
uni-rs/uni.rs
72096ad98640fe3f4eadd7710f24c90c89779c18
src/rust/lib.rs
src/rust/lib.rs
#![feature(const_fn)] #![feature(extern_types)] #![feature(or_patterns)] #[cfg(test)] #[macro_use] extern crate quickcheck; #[macro_use] mod dbg; #[macro_use] mod paging; pub mod cpu; pub mod js_api; pub mod profiler; mod analysis; mod codegen; mod config; mod cpu_context; mod gen; mod jit; mod jit_instructions; ...
#![feature(const_fn)] #![feature(extern_types)] #![feature(or_patterns)] #![allow(const_item_mutation)] #[cfg(test)] #[macro_use] extern crate quickcheck; #[macro_use] mod dbg; #[macro_use] mod paging; pub mod cpu; pub mod js_api; pub mod profiler; mod analysis; mod codegen; mod config; mod cpu_context; mod gen; ...
Disable const item mutation warning (triggers on pointers)
Disable const item mutation warning (triggers on pointers)
Rust
bsd-2-clause
copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86
ed0db25ac3e82affea28cd6a5ef7391d2e8a4135
tests-ios/prelude.rs
tests-ios/prelude.rs
extern crate native_tls; pub use native_tls::*;
extern crate native_tls; pub use native_tls::*; macro_rules! p { ($e:expr) => { match $e { Ok(r) => r, Err(e) => panic!("{:?}", e), } } }
Add p macro for tests
Add p macro for tests
Rust
apache-2.0
sfackler/rust-native-tls
8598503900db739b4bf1a87ad4cab3f7545a6255
fuzz/fuzzers/fuzzer_script_tga.rs
fuzz/fuzzers/fuzzer_script_tga.rs
#![no_main] #[macro_use] extern crate libfuzzer_sys; extern crate image; fuzz_target!(|data: &[u8]| { let _ = image::load_from_memory_with_format(data, image::ImageFormat::Tga); });
#![no_main] #[macro_use] extern crate libfuzzer_sys; extern crate image; fuzz_target!(|data: &[u8]| { let _ = decode(data); }); fn decode(data: &[u8]) -> Result<(), image::ImageError> { use image::ImageDecoder; let decoder = image::codecs::tga::TgaDecoder::new(std::io::Cursor::new(data))?; if decoder....
Update fuzzer script with upper size bound
Update fuzzer script with upper size bound
Rust
mit
PistonDevelopers/image,PistonDevelopers/image
9f788f3a2b7626318d0bdedca38986fc283f481f
src/test/rustdoc/const-generics/const-impl.rs
src/test/rustdoc/const-generics/const-impl.rs
// ignore-tidy-linelength #![feature(const_generics)] #![crate_name = "foo"] pub enum Order { Sorted, Unsorted, } // @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>' // @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const ORDER: Order, T> Send fo...
// ignore-tidy-linelength #![feature(const_generics)] #![crate_name = "foo"] #[derive(PartialEq, Eq)] pub enum Order { Sorted, Unsorted, } // @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>' // @has foo/struct.VSet.html '//h3[@id="impl-Send"]/code' 'impl<const...
Fix rustdoc const generics test
Fix rustdoc const generics test
Rust
apache-2.0
aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust
1c780b420308cc9f57a5cb5b9619d43c1a4e6f44
src/test/stdtest/os.rs
src/test/stdtest/os.rs
import std::generic_os::setenv; import std::generic_os::getenv; import std::option; #[test] fn test_setenv() { setenv("NAME", "VALUE"); assert getenv("NAME") == option::some("VALUE"); } #[test] fn test_setenv_overwrite() { setenv("NAME", "1"); setenv("NAME", "2"); assert getenv("NAME") == option::...
import std::generic_os::setenv; import std::generic_os::getenv; import std::option; #[test] fn test_setenv() { // NB: Each test of setenv needs to use different variable names or the // tests will not be threadsafe setenv("NAME1", "VALUE"); assert getenv("NAME1") == option::some("VALUE"); } #[test] fn...
Make the setenv tests threadsafe(ish)
Make the setenv tests threadsafe(ish)
Rust
apache-2.0
vhbit/rust,emk/rust,jashank/rust,Ryman/rust,pelmers/rust,huonw/rand,aepsil0n/rust,jroesch/rust,reem/rust,untitaker/rust,rohitjoshi/rust,andars/rust,kmcallister/rust,zubron/rust,nham/rust,0x73/rust,untitaker/rust,philyoon/rust,aturon/rust,gifnksm/rust,sarojaba/rust-doc-korean,jashank/rust,kwantam/rust,erickt/rust,stepan...
cc5d8bfceb33efdb3481810b5c450398b6b2a9ac
fitsio-sys/build.rs
fitsio-sys/build.rs
extern crate pkg_config; fn main() { println!("cargo:rerun-if-changed=build.rs"); pkg_config::probe_library("cfitsio").unwrap(); }
extern crate pkg_config; use std::io::Write; use pkg_config::Error; fn main() { let package_name = "cfitsio"; match pkg_config::probe_library(package_name) { Ok(_) => {} Err(Error::Failure { output, .. }) => { // Handle the case where the user has not installed cfitsio, and thusly...
Handle missing cfitsio on pkg-config path
Handle missing cfitsio on pkg-config path
Rust
apache-2.0
mindriot101/rust-fitsio,mindriot101/rust-cfitsio,mindriot101/rust-fitsio,mindriot101/rust-cfitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio
1464c11cea5e737be4ccc30dc5132f297bc59e0c
tests/compiletest/plugin/lib.rs
tests/compiletest/plugin/lib.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ extern crate compiletest_helper; #[macro_use] extern crate deny_public_fields; #[test] fn compile_test() { co...
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ extern crate compiletest_helper; #[test] fn compile_test() { compiletest_helper::run_mode("compile-fail"); }
Fix a warning in plugin compile tests
Fix a warning in plugin compile tests
Rust
mpl-2.0
sadmansk/servo,peterjoel/servo,notriddle/servo,eddyb/servo,mattnenterprise/servo,SimonSapin/servo,anthgur/servo,szeged/servo,emilio/servo,peterjoel/servo,jimberlage/servo,larsbergstrom/servo,CJ8664/servo,avadacatavra/servo,szeged/servo,szeged/servo,CJ8664/servo,KiChjang/servo,jimberlage/servo,nnethercote/servo,notriddl...
1825de8fbbda764a2a3f4853816ae2e87428856c
examples/generate_integers.rs
examples/generate_integers.rs
extern crate randomorg; fn main() { use randomorg::Random; let r = Random::new("API KEY HERE"); println!("Result: {:?}", r.generate_integers(-100, 100, 15, true)); }
extern crate randomorg; fn main() { use std::env; use randomorg::Random; let r = Random::new(env::var("RANDOM_ORG_API_KEY").unwrap()); println!("Result: {:?}", r.generate_integers(-100, 100, 15, true).unwrap()); }
Use environment variable in the example
Use environment variable in the example This will help in reproducing problems in nightly builds.
Rust
mit
vityafx/randomorg
933efd755b1cad9ec5046f315ac4e1f95ab9baba
src/test/run-pass/issues/issue-18804/main.rs
src/test/run-pass/issues/issue-18804/main.rs
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Address LLVM assertion failure by prepopulating with *just* name-anon-globals.
Address LLVM assertion failure by prepopulating with *just* name-anon-globals.
Rust
apache-2.0
graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust
faad7e209deee6d09d335ca00c06d9f41bc040b5
src/test/ui/proc-macro/auxiliary/api/cmp.rs
src/test/ui/proc-macro/auxiliary/api/cmp.rs
use proc_macro::{LineColumn, Punct}; pub fn test() { test_line_column_ord(); test_punct_eq(); } fn test_line_column_ord() { let line0_column0 = LineColumn { line: 0, column: 0 }; let line0_column1 = LineColumn { line: 0, column: 1 }; let line1_column0 = LineColumn { line: 1, column: 0 }; asser...
use proc_macro::{LineColumn, Punct, Spacing}; pub fn test() { test_line_column_ord(); test_punct_eq(); } fn test_line_column_ord() { let line0_column0 = LineColumn { line: 0, column: 0 }; let line0_column1 = LineColumn { line: 0, column: 1 }; let line1_column0 = LineColumn { line: 1, column: 0 }; ...
Make a more meaningful test for Punct eq
Make a more meaningful test for Punct eq
Rust
apache-2.0
graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust
15b4734d0c1b6e8689d6715ef8b808f5ce6f546c
src/test/run-pass/shebang.rs
src/test/run-pass/shebang.rs
#!/usr/bin/env rustx // pp-exact use io::println; fn main() { io::println(~"Hello World"); }
#!/usr/bin/env rustx // pp-exact fn main() { io::println("Hello World"); }
Remove 'use' line that's confusing pp-exact during use/import transition.
Remove 'use' line that's confusing pp-exact during use/import transition.
Rust
apache-2.0
zubron/rust,pythonesque/rust,michaelballantyne/rust-gpu,mitsuhiko/rust,aidancully/rust,bombless/rust,aidancully/rust,jroesch/rust,pshc/rust,AerialX/rust-rt-minimal,philyoon/rust,andars/rust,mvdnes/rust,dwillmer/rust,michaelballantyne/rust-gpu,TheNeikos/rust,ktossell/rust,carols10cents/rust,nwin/rust,shepmaster/rand,Sie...
bda6d1f158a71efe84d86da2011eac0c45a232c5
compiler/rustc_data_structures/src/memmap.rs
compiler/rustc_data_structures/src/memmap.rs
use std::fs::File; use std::io; use std::ops::Deref; use crate::owning_ref::StableAddress; /// A trivial wrapper for [`memmap2::Mmap`] that implements [`StableAddress`]. #[cfg(not(target_arch = "wasm32"))] pub struct Mmap(memmap2::Mmap); #[cfg(target_arch = "wasm32")] pub struct Mmap(Vec<u8>); #[cfg(not(target_arch...
use std::fs::File; use std::io; use std::ops::Deref; use crate::owning_ref::StableAddress; /// A trivial wrapper for [`memmap2::Mmap`] that implements [`StableAddress`]. #[cfg(not(target_arch = "wasm32"))] pub struct Mmap(memmap2::Mmap); #[cfg(target_arch = "wasm32")] pub struct Mmap(Vec<u8>); #[cfg(not(target_arch...
Add safety comment to StableAddress impl for Mmap
Add safety comment to StableAddress impl for Mmap
Rust
apache-2.0
aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust
31d7b90e30de5f90891e4a845f6704e4c13748df
thrift/lib/rust/src/dep_tests/cargo_thrift/thrift_build.rs
thrift/lib/rust/src/dep_tests/cargo_thrift/thrift_build.rs
// @generated by autocargo use std::env; use std::fs; use std::path::Path; use thrift_compiler::Config; #[rustfmt::skip] fn main() { let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR env not provided"); let out_dir: &Path = out_dir.as_ref(); fs::write( out_dir.join("cratemap"), "test_th...
// @generated by autocargo use std::env; use std::fs; use std::path::Path; use thrift_compiler::Config; #[rustfmt::skip] fn main() { // Rerun if this gets rewritten. println!("cargo:rerun-if-changed=thrift_build.rs"); let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR env not provided"); let out_di...
Update autocargo component on FBS:master
Update autocargo component on FBS:master Summary: Automated component version update Bump Schedule: https://www.internalfb.com/intern/msdk/bump/?schedule_fbid=342556550408072 Package: https://www.internalfb.com/intern/msdk/package/125803836415945/ Oncall Team: rust_foundation NOTE: This build is expected to expire at ...
Rust
apache-2.0
facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift
c11dfb6b10254318ba0e157866480fcc877f7685
crates/ruma-federation-api/src/discovery/get_server_versions.rs
crates/ruma-federation-api/src/discovery/get_server_versions.rs
//! Endpoint to receive metadata about implemented matrix versions. pub mod msc3723 { //! [GET /_matrix/federation/versions](https://github.com/matrix-org/matrix-doc/pull/3723) use ruma_common::api::ruma_api; ruma_api! { metadata: { description: "Get the supported matrix versions of t...
//! Endpoint to receive metadata about implemented matrix versions. pub mod msc3723 { //! [GET /_matrix/federation/versions](https://github.com/matrix-org/matrix-spec-proposals/pull/3723) use ruma_common::api::ruma_api; ruma_api! { metadata: { description: "Get the supported matrix ve...
Fix link to old matrix-doc repo
federation-api: Fix link to old matrix-doc repo
Rust
mit
ruma/ruma
82208d3a054a2a0f31725d0165968a84aa4d8d93
build.rs
build.rs
extern crate pkg_config; fn main () { pkg_config::probe_library("fuse").unwrap(); }
extern crate pkg_config; #[cfg(not(target_os = "macos"))] static LIBFUSE_NAME: &str = "fuse"; #[cfg(target_os = "macos")] static LIBFUSE_NAME: &str = "osxfuse"; fn main () { pkg_config::Config::new().atleast_version("2.6.0").probe(LIBFUSE_NAME).unwrap(); }
Use recommended pkg-config method to discover libfuse
Use recommended pkg-config method to discover libfuse
Rust
mit
zargony/rust-fuse
c562346192bbf0790338adf94f9590a2396c5d41
src/bin/table_test.rs
src/bin/table_test.rs
extern crate uosql; use uosql::storage::*; fn main() { //let db = Database::create("storage_team").unwrap(); let db = Database::load("storage_team").unwrap(); let mut cols = Vec::new(); cols.push(Column { name: "Heiner".into(), data_type: DataType::Integer }); cols.push(Column { name: "Mathias"....
extern crate uosql; use uosql::storage::*; fn main() { //let db = Database::create("storage_team").unwrap(); let db = Database::load("storage_team").unwrap(); let mut cols = Vec::new(); cols.push(Column { name: "Heiner".into(), data_type: DataType::Integer }); cols.push(Column { name: "Mathias"....
Remove line with unimplemented function
Remove line with unimplemented function
Rust
mit
tempbottle/uosql-server,tempbottle/uosql-server,OsnaCS/uosql-server,tempbottle/uosql-server,OsnaCS/uosql-server,OsnaCS/uosql-server
c22ea027ff33663edcb9043d8de219067dc39ae7
src/lib.rs
src/lib.rs
//! Furry Fiesta is a library for poker. //! It's mostly meant for Holdem games, however the core functionality //! should work for all game types. //! //! # Implemented: //! Currently Furry Fiesta supports: //! //! * Hand Iteration. //! * Hand Ranking. //! * Hand Range parsing. //! * Hand Range generation. //! //! # P...
//! Furry Fiesta is a library for poker. //! It's mostly meant for Holdem games, however the core functionality //! should work for all game types. //! //! # Implemented: //! Currently Furry Fiesta supports: //! //! * Hand Iteration. //! * Hand Ranking. //! * Hand Range parsing. //! * Hand Range generation. //! //! # P...
Remove box syntax feature since it's not used
Remove box syntax feature since it's not used
Rust
apache-2.0
elliottneilclark/rs-poker,elliottneilclark/furry-fiesta
de388032555b697d1b0ef197241886ab90ac39b2
src/librustc_target/spec/i686_unknown_freebsd.rs
src/librustc_target/spec/i686_unknown_freebsd.rs
use crate::spec::{LinkerFlavor, Target, TargetResult}; pub fn target() -> TargetResult { let mut base = super::freebsd_base::opts(); base.cpu = "pentium4".to_string(); base.max_atomic_width = Some(64); base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string()); base.stack_prob...
use crate::spec::{LinkerFlavor, Target, TargetResult}; pub fn target() -> TargetResult { let mut base = super::freebsd_base::opts(); base.cpu = "pentium4".to_string(); base.max_atomic_width = Some(64); let pre_link_args = base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap(); pre_link_args.push("...
Add -Wl,-znotext to default linker flags to link with lld 9 on FreeBSD 13.0-CURRENT i386
Add -Wl,-znotext to default linker flags to link with lld 9 on FreeBSD 13.0-CURRENT i386 rust-nightly has been failing to link since 2019-12-10 with variations of ``` = note: ld: error: relocation R_386_PC32 cannot be used against symbol __rust_probestack; recompile with -fPIC >>> defined in /wrkdirs/usr/po...
Rust
apache-2.0
aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust
155faafb04edca61ea559f89818b77a356f98343
src/librustc_back/target/armv7_linux_androideabi.rs
src/librustc_back/target/armv7_linux_androideabi.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Add missing "max_atomic_width" to new armv7 android target.
Add missing "max_atomic_width" to new armv7 android target.
Rust
apache-2.0
aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust
3636ce7875dc71d907789a779c1c1cb5973e021f
src/test/compile-fail/expanded-cfg.rs
src/test/compile-fail/expanded-cfg.rs
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Test that a feature gated cfg variable in a `cfg_attr` on an unconfigured item is allowed
Test that a feature gated cfg variable in a `cfg_attr` on an unconfigured item is allowed
Rust
apache-2.0
GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust
7c5526bee4c9bae95800a18aaf6cc9e55562fd5a
src/lib.rs
src/lib.rs
#![feature(phase)] #[phase(plugin)] extern crate regex_macros; extern crate regex; use std::collections::HashMap; mod lexer; mod parser; struct Liquid { text: String, content: HashMap<String, String> } impl Liquid { pub fn new(text: &str) -> Liquid { Liquid { text: text.to_string(), content: Has...
#![feature(phase)] #[phase(plugin)] extern crate regex_macros; extern crate regex; use std::collections::HashMap; mod lexer; mod parser; struct Liquid { text: String, content: HashMap<String, String> } impl Liquid { fn new(text: &str) -> Liquid { Liquid { text: text.to_string(), content: HashMap...
Add &self to Liquid method
Add &self to Liquid method
Rust
mit
cobalt-org/liquid-rust,kaj/liquid-rust,tcsc/liquid-rust,Albibek/liquid-rust
ffe74b7a3b7647019af2a0962a3dcd8db72a4952
src/test/compile-fail/view-items-at-top.rs
src/test/compile-fail/view-items-at-top.rs
use std; fn f() { } import std::io::println; //~ ERROR view items must be declared at the top fn main() { }
use std; fn f() { } import std::net; //~ ERROR view items must be declared at the top fn main() { }
Use a mod that exists in view-item-at-top
test: Use a mod that exists in view-item-at-top
Rust
apache-2.0
sae-bom/rust,hauleth/rust,quornian/rust,kimroen/rust,graydon/rust,omasanori/rust,pshc/rust,kimroen/rust,rprichard/rust,rprichard/rust,rprichard/rust,servo/rust,aepsil0n/rust,emk/rust,defuz/rust,avdi/rust,omasanori/rust,pythonesque/rust,vhbit/rust,stepancheg/rust-ide-rust,quornian/rust,pczarn/rust,miniupnp/rust,pelmers/...
28885635108c6def3c2503cbcaeba90fbd011f90
src/test/compile-fail/regions-in-structs.rs
src/test/compile-fail/regions-in-structs.rs
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Fix botched error message in compile-fail test
test: Fix botched error message in compile-fail test
Rust
apache-2.0
aturon/rust,dwillmer/rust,seanrivera/rust,rohitjoshi/rust,l0kod/rust,mahkoh/rust,jbclements/rust,jashank/rust,0x73/rust,servo/rust,arthurprs/rand,cllns/rust,barosl/rust,nham/rust,victorvde/rust,KokaKiwi/rust,untitaker/rust,mahkoh/rust,nwin/rust,philyoon/rust,pczarn/rust,mdinger/rust,nwin/rust,defuz/rust,kimroen/rust,py...
7234146529386a0d59817055c847b5e906ab605c
src/lib.rs
src/lib.rs
#![cfg(any(target_arch="x86", target_arch="x86_64"))] #![feature(const_fn)] #![feature(asm)] #![feature(associated_consts)] #![no_std] #![cfg_attr(test, allow(unused_features))] #[macro_use] extern crate bitflags; #[macro_use] extern crate raw_cpuid; #[cfg(feature = "performance-counter")] #[macro_use] extern crate...
#![cfg(any(target_arch="x86", target_arch="x86_64"))] #![feature(const_fn)] #![feature(asm)] #![feature(associated_consts)] #![no_std] #![cfg_attr(test, allow(unused_features))] #[macro_use] extern crate bitflags; #[macro_use] extern crate raw_cpuid; #[cfg(feature = "performance-counter")] #[macro_use] extern crate...
Add `::current` module for whichever of `bits{32,64}` is active
Add `::current` module for whichever of `bits{32,64}` is active
Rust
mit
phil-opp/rust-x86_64,rexlunae/redox,rexlunae/redox,gz/rust-x86,gz/rust-x86,rexlunae/redox
e5299c9a2fec3a0e826f53374884523c17927803
filesystem/apps/sodium/exec.rs
filesystem/apps/sodium/exec.rs
use super::*; use redox::*; impl Editor { pub fn exec(&mut self, Inst(n, cmd): Inst) { use super::Mode::*; use super::PrimitiveMode::*; use super::CommandMode::*; match self.cursor().mode { Command(Normal) => match cmd { 'i' => { self....
use super::*; use redox::*; impl Editor { pub fn exec(&mut self, Inst(n, cmd): Inst) { use super::Mode::*; use super::PrimitiveMode::*; use super::CommandMode::*; match self.cursor().mode { Command(Normal) => match cmd { 'i' => { self....
Add $ and 0 commands
Add $ and 0 commands
Rust
mit
Lacaranian/redox,rexlunae/redox,Lacaranian/redox,Lacaranian/redox,rexlunae/redox,Lacaranian/redox,rexlunae/redox,Lacaranian/redox
e224ceb4e4af3743391bdeaeeb410ba53e84e0bc
src/main.rs
src/main.rs
extern crate rand; use rand::thread_rng; use rand::distributions::Range; use individual::Individual; mod individual; fn main() { let mut rng = thread_rng(); let range = Range::new(-512.03_f64, 511.97); // range for Schwefel problem // initialize population let mut population: Vec<_> = (0..128).map(|...
extern crate rand; use rand::thread_rng; use rand::distributions::Range; use individual::Individual; mod individual; fn main() { let mut rng = thread_rng(); let range = Range::new(-512.03_f64, 511.97); // range for Schwefel problem // initialize population let mut population: Vec<_> = (0..128).map(|...
Print only every 100th iteration
Print only every 100th iteration
Rust
agpl-3.0
andschwa/rust-genetic-algorithm
00ae07be075d313f077c383927bc1daa45c752b0
src/lib.rs
src/lib.rs
#![feature( btree_range, collections, collections_bound, question_mark, rustc_private, pub_restricted, )] // From rustc. #[macro_use] extern crate rustc; extern crate rustc_borrowck; extern crate rustc_data_structures; extern crate rustc_mir; extern crate rustc_const_math; extern crate syntax; ...
#![feature( btree_range, collections, collections_bound, rustc_private, pub_restricted, )] // From rustc. #[macro_use] extern crate rustc; extern crate rustc_borrowck; extern crate rustc_data_structures; extern crate rustc_mir; extern crate rustc_const_math; extern crate syntax; #[macro_use] extern...
Update for changes in rustc.
Update for changes in rustc.
Rust
apache-2.0
graydon/rust,aidancully/rust,aidancully/rust,rust-lang/miri,GBGamer/rust,graydon/rust,rust-lang/miri,aidancully/rust,graydon/rust,GBGamer/rust,GBGamer/rust,graydon/rust,tsion/miri,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,rust-lang/miri,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust...
2cdc7af41366182259a05435e325d7444653a3e8
src/test/compile-fail/rfc-1937-termination-trait/termination-trait-main-i32.rs
src/test/compile-fail/rfc-1937-termination-trait/termination-trait-main-i32.rs
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Use NOTE instead of error-pattern directive
Use NOTE instead of error-pattern directive
Rust
apache-2.0
aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust
5b0164b0fa950e384e91c807e79df4b51a4bcd50
test/std.rs
test/std.rs
#![feature(custom_attribute, box_syntax)] #![allow(dead_code, unused_attributes)] #[miri_run] fn rc_cell() -> i32 { use std::rc::Rc; use std::cell::Cell; let r = Rc::new(Cell::new(42)); let x = r.get(); r.set(x + x); r.get() } #[miri_run] fn arc() -> i32 { use std::sync::Arc; let a = A...
#![feature(custom_attribute, box_syntax)] #![allow(dead_code, unused_attributes)] #[miri_run] fn rc_cell() -> i32 { use std::rc::Rc; use std::cell::Cell; let r = Rc::new(Cell::new(42)); let x = r.get(); r.set(x + x); r.get() } #[miri_run] fn arc() -> i32 { use std::sync::Arc; let a = A...
Add simple test of assert_eq!.
Add simple test of assert_eq!.
Rust
apache-2.0
aidancully/rust,aidancully/rust,aidancully/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,rust-lang/miri,rust-lang/miri,aidancully/rust,graydon/rust,rust-lang/miri,tsion/miri,graydon/rust,rust-lang/mi...
16b27bbeadff1c61ce36e09180b18aedc7ec27b2
src/test/run-pass/unboxed-closures-by-ref.rs
src/test/run-pass/unboxed-closures-by-ref.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Fix unit test that was illegally mutating an upvar
Fix unit test that was illegally mutating an upvar
Rust
apache-2.0
l0kod/rust,emk/rust,mihneadb/rust,untitaker/rust,carols10cents/rust,aneeshusa/rust,avdi/rust,jroesch/rust,pshc/rust,aepsil0n/rust,untitaker/rust,mdinger/rust,mvdnes/rust,jroesch/rust,ejjeong/rust,vhbit/rust,cllns/rust,graydon/rust,gifnksm/rust,rprichard/rust,kimroen/rust,aepsil0n/rust,seanrivera/rust,carols10cents/rust...
6b5d91e4472dd74526da1b630ae71fdeb50d845d
imag-diary/src/view.rs
imag-diary/src/view.rs
use std::process::exit; use libimagdiary::diary::Diary; use libimagentryview::viewer::Viewer; use libimagentryview::builtin::plain::PlainViewer; use libimagrt::runtime::Runtime; use libimagerror::trace::trace_error; use util::get_diary_name; pub fn view(rt: &Runtime) { let diaryname = get_diary_name(rt); if ...
use std::process::exit; use libimagdiary::diary::Diary; use libimagentryview::viewer::Viewer; use libimagentryview::builtin::plain::PlainViewer; use libimagrt::runtime::Runtime; use libimagerror::trace::trace_error; use util::get_diary_name; pub fn view(rt: &Runtime) { let diaryname = get_diary_name(rt).unwrap_o...
Replace is_none() -> unwrap() with unwrap_or_else()
Replace is_none() -> unwrap() with unwrap_or_else()
Rust
lgpl-2.1
matthiasbeyer/imag,mario-kr/imag,matthiasbeyer/imag,mario-kr/imag
530315a220866df8c34c3a3551b4eef949eea23a
test/strings.rs
test/strings.rs
#![feature(custom_attribute)] #![allow(dead_code, unused_attributes)] #[miri_run] fn empty() -> &'static str { "" } #[miri_run] fn hello() -> &'static str { "Hello, world!" } #[miri_run] fn hello_bytes() -> &'static [u8; 13] { b"Hello, world!" }
#![feature(custom_attribute)] #![allow(dead_code, unused_attributes)] #[miri_run] fn empty() -> &'static str { "" } #[miri_run] fn hello() -> &'static str { "Hello, world!" } #[miri_run] fn hello_bytes() -> &'static [u8; 13] { b"Hello, world!" } #[miri_run] fn hello_bytes_fat() -> &'static [u8] { b"...
Add a fat byte-slice coercion test.
Add a fat byte-slice coercion test.
Rust
apache-2.0
aidancully/rust,graydon/rust,graydon/rust,tsion/miri,GBGamer/rust,GBGamer/rust,rust-lang/miri,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,rust-lang/miri,aidancully/rust,GBGamer/rust,GBGamer/rust,rust-lang/miri,rust-lang/miri,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/ru...
6c6d7c3916fade4549caf4dd9380d23fc3d3d040
src/test/run-pass/item-attributes.rs
src/test/run-pass/item-attributes.rs
// xfail-stage0 #[attr = "val"] const int x = 10; #[attr = "val"] mod mod1 { } #[attr = "val"] native "rust" mod rustrt { } #[attr = "val"] type t = obj { }; #[attr = "val"] obj o() { } fn main() { }
// xfail-stage0 mod test_single_attr_outer { #[attr = "val"] const int x = 10; #[attr = "val"] mod mod1 { } #[attr = "val"] native "rust" mod rustrt { } #[attr = "val"] type t = obj { }; #[attr = "val"] obj o() { } } mod test_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] co...
Add tests for multiple outer attributes on items
test: Add tests for multiple outer attributes on items Issue #487
Rust
apache-2.0
sarojaba/rust-doc-korean,KokaKiwi/rust,bombless/rust,philyoon/rust,jroesch/rust,j16r/rust,untitaker/rust,jbclements/rust,rprichard/rust,jbclements/rust,michaelballantyne/rust-gpu,philyoon/rust,nwin/rust,emk/rust,XMPPwocky/rust,mahkoh/rust,emk/rust,kmcallister/rust,kwantam/rust,l0kod/rust,mitsuhiko/rust,servo/rust,mding...
b9f0831d1839db86beab44e0dcd29ee5fcc028a2
src/color.rs
src/color.rs
use num; pub trait Color: Clone + PartialEq { type Tag; type ChannelsTuple; fn num_channels() -> u32; fn from_tuple(values: Self::ChannelsTuple) -> Self; fn to_tuple(self) -> Self::ChannelsTuple; } pub trait PolarColor: Color { type Angular; type Cartesian; } pub trait Flatten: Color { ...
use num; pub trait Color: Clone + PartialEq { type Tag; type ChannelsTuple; fn num_channels() -> u32; fn from_tuple(values: Self::ChannelsTuple) -> Self; fn to_tuple(self) -> Self::ChannelsTuple; } pub trait PolarColor: Color { type Angular; type Cartesian; } pub trait Flatten: Color { ...
Remove ColorCast trait for now
Remove ColorCast trait for now
Rust
mit
tylerreisinger/rust-color
502a03e2c6bbcaf23892443a464e5caa423b8855
src/renderers/mod.rs
src/renderers/mod.rs
pub mod wireframe; pub mod filled; pub mod textured; /// Do perspective calculation on a point, return (x, y). fn perpective(x: f32, y: f32, z: f32) -> (f32, f32) { (x/z, y/z) } /// Turn floating point coordinates to something drawable on the screen, return (x, y) fn screen(x: f32, y: f32, screen_width: i32, scre...
pub mod wireframe; pub mod filled; pub mod textured; /// Do perspective calculation on a point, return (x, y). fn perpective(x: f32, y: f32, z: f32) -> (f32, f32) { (x/z, y/z) } /// Turn floating point coordinates to something drawable on the screen, return (x, y) fn screen(x: f32, y: f32, screen_width: i32, scre...
Add floating point normalized to screen coordinate conversion
Add floating point normalized to screen coordinate conversion
Rust
mit
ca1ek/tetrahedrane
148b5e4e108fbcdb033eabc76536f65deb181d4f
src/librustc_back/target/i686_linux_android.rs
src/librustc_back/target/i686_linux_android.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Update i686-linux-android features to match android ABI.
Update i686-linux-android features to match android ABI.
Rust
apache-2.0
aidancully/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust
a41e8be8c6e0712ab5c1115c53a8cdcf8d53b52a
examples/ops/operator.rs
examples/ops/operator.rs
struct Foo; struct Bar; #[deriving(Show)] struct FooBar; #[deriving(Show)] struct BarFoo; // The `Add<T, U>` trait needs two generic parameters: // * T is the type of the RHS summand, and // * U is the type of the sum // This block implements the operation: Foo + Bar = FooBar impl Add<Bar, FooBar> for Foo { fn a...
use std::ops::Add; struct Foo; struct Bar; #[derive(Show)] struct FooBar; #[derive(Show)] struct BarFoo; // The `Add<T, U>` trait needs two generic parameters: // * T is the type of the RHS summand, and // * U is the type of the sum // This block implements the operation: Foo + Bar = FooBar impl Add<Bar> for Foo { ...
Fix ops example according to latest nightly
Fix ops example according to latest nightly
Rust
apache-2.0
brunotag/rust-by-example,rwaldron/rust-by-example,colinvh/rust-by-example,shaleh/rust-by-example,DenisKolodin/rust-by-example,zhjh1209/rust-by-example,rust-lang-cn/rust-by-example-cn,XadillaX/zh-rust-by-example,mdinger/rust-by-example,rustcc/rust-by-example,nodakai/rust-by-example,youprofit/rust-by-example,realcr/rust-...
44aed626bf56b72af4934768e9fa31ad4439935a
src/test/run-pass/syntax-extension-fmt.rs
src/test/run-pass/syntax-extension-fmt.rs
// xfail-boot // xfail-stage0 use std; import std._str; fn test(str actual, str expected) { log actual; log expected; check (_str.eq(actual, expected)); } fn main() { test(#fmt("hello %d friends and %s things", 10, "formatted"), "hello 10 friends and formatted things"); // Simple tests for types test...
// xfail-boot // xfail-stage0 use std; import std._str; fn test(str actual, str expected) { log actual; log expected; check (_str.eq(actual, expected)); } fn main() { test(#fmt("hello %d friends and %s things", 10, "formatted"), "hello 10 friends and formatted things"); // Simple tests for types test...
Add ExtFmt test for unsigned type
Add ExtFmt test for unsigned type
Rust
apache-2.0
mitsuhiko/rust,LeoTestard/rust,vhbit/rust,rohitjoshi/rust,barosl/rust,kmcallister/rust,l0kod/rust,andars/rust,kimroen/rust,dinfuehr/rust,defuz/rust,fabricedesre/rust,0x73/rust,GBGamer/rust,seanrivera/rust,j16r/rust,robertg/rust,SiegeLord/rust,ktossell/rust,GBGamer/rust,AerialX/rust,ejjeong/rust,kimroen/rust,zachwick/ru...
b450aff18689ea0d0695b4f5a59bb360ae549f87
src/test/compile-fail/issue-23173.rs
src/test/compile-fail/issue-23173.rs
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Add test to new branches
Add test to new branches
Rust
apache-2.0
GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,aidancully/rust
9236f15a67f32404b5e74ab2b532ec5accb59cbe
tests/s3.rs
tests/s3.rs
#![cfg(feature = "s3")] extern crate env_logger; #[macro_use] extern crate log; extern crate time; #[macro_use] extern crate rusoto; use rusoto::{DefaultCredentialsProvider, Region}; use rusoto::s3::{S3Error, S3Helper}; #[test] fn all_s3_tests() { let _ = env_logger::init(); info!("s3 integration tests star...
#![cfg(feature = "s3")] extern crate env_logger; #[macro_use] extern crate log; extern crate time; #[macro_use] extern crate rusoto; use std::io::Read; use std::fs::File; use rusoto::{DefaultCredentialsProvider, Region}; use rusoto::s3::S3Helper; #[test] fn list_buckets_tests() { let _ = env_logger::init(); ...
Return of basic S3 tests.
Return of basic S3 tests.
Rust
mit
DualSpark/rusoto,indiv0/rusoto,DualSpark/rusoto,DualSpark/rust-aws,DualSpark/rusoto,ford-prefect/rusoto,rusoto/rusoto,DualSpark/rust-aws,rusoto/rusoto,mattico/rusoto,noggleboggle/rusoto,rusoto/rusoto,mthjones/rusoto,SecurityInsanity/rusoto,mthjones/rusoto,SecurityInsanity/rusoto,DualSpark/rust-aws,mattico/rusoto,cmsd2/...
e7f08822147c495592bef83eeb835640a6342a2a
src/test/run-pass/c-stack-returning-int64.rs
src/test/run-pass/c-stack-returning-int64.rs
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Fix a stack to use the new .to_c_str() api
Fix a stack to use the new .to_c_str() api
Rust
apache-2.0
ruud-v-a/rust,SiegeLord/rust,emk/rust,philyoon/rust,erickt/rust,philyoon/rust,ejjeong/rust,pelmers/rust,AerialX/rust,philyoon/rust,rohitjoshi/rust,pshc/rust,barosl/rust,ebfull/rust,nham/rust,rprichard/rust,XMPPwocky/rust,reem/rust,miniupnp/rust,GBGamer/rust,0x73/rust,Ryman/rust,zubron/rust,0x73/rust,jbclements/rust,ste...
eba74f50d98ef060a51ab97b254e80e40ee61329
src/lib.rs
src/lib.rs
#![feature(core)] #![feature(io)] #![feature(std_misc)] #![feature(step_by)] #![feature(test)] extern crate byteorder; extern crate flate2; extern crate nbt; extern crate "rustc-serialize" as rustc_serialize; extern crate test; extern crate time; extern crate uuid; pub mod packet; pub mod proto; pub mod types; mod ut...
#![feature(core)] #![feature(io)] #![feature(std_misc)] #![feature(step_by)] #![feature(test)] extern crate byteorder; extern crate flate2; extern crate nbt; extern crate rustc_serialize; extern crate test; extern crate time; extern crate uuid; pub mod packet; pub mod proto; pub mod types; mod util;
Update rustc-serialize import to new syntax
Update rustc-serialize import to new syntax
Rust
mit
toqueteos/hematite_server,PistonDevelopers/hematite_server,fenhl/hematite_server
9b2d988df0ffefab9ade36763b7bf41b5862b105
src/test/run-pass/issue-506.rs
src/test/run-pass/issue-506.rs
/* A reduced test case for Issue #506, provided by Rob Arnold. */ use std; import task; #[abi = "cdecl"] extern mod rustrt { fn rust_task_allow_kill(); } fn main() { task::spawn(rustrt::rust_task_allow_kill); }
/* A reduced test case for Issue #506, provided by Rob Arnold. Testing spawning foreign functions */ use std; import task; #[abi = "cdecl"] extern mod rustrt { fn unsupervise(); } fn main() { task::spawn(rustrt::unsupervise); }
Fix test that was using rust_task_allow_kill incorrectly
Fix test that was using rust_task_allow_kill incorrectly
Rust
apache-2.0
kmcallister/rust,AerialX/rust,sarojaba/rust-doc-korean,mvdnes/rust,fabricedesre/rust,vhbit/rust,robertg/rust,kimroen/rust,quornian/rust,servo/rust,michaelballantyne/rust-gpu,KokaKiwi/rust,pythonesque/rust,avdi/rust,barosl/rust,krzysz00/rust,sarojaba/rust-doc-korean,nham/rust,l0kod/rust,krzysz00/rust,philyoon/rust,0x73/...
c29f1af17e49ae01d865f443ea0ff2f92bf3a888
src/test/compile-fail/constrained-type-missing-check.rs
src/test/compile-fail/constrained-type-missing-check.rs
// -*- rust -*- // xfail-test // error-pattern:Unsatisfied precondition tag list { cons(int, @list); nil; } type bubu = {x: int, y: int}; pure fn less_than(x: int, y: int) -> bool { ret x < y; } type ordered_range = {low: int, high: int} : less_than(low, high); fn main() { // Should fail to compile, b/c we're ...
// -*- rust -*- // xfail-test // error-pattern:Unsatisfied precondition pure fn less_than(x: int, y: int) -> bool { ret x < y; } type ordered_range = {low: int, high: int} : less_than(low, high); fn main() { // Should fail to compile, b/c we're not doing the check // explicitly that a < b let a: int = 1;...
Remove irrelevant parts of test
Remove irrelevant parts of test
Rust
apache-2.0
miniupnp/rust,michaelballantyne/rust-gpu,aturon/rust,ejjeong/rust,untitaker/rust,kimroen/rust,quornian/rust,ebfull/rust,zubron/rust,miniupnp/rust,0x73/rust,stepancheg/rust-ide-rust,stepancheg/rust-ide-rust,nham/rust,victorvde/rust,dwillmer/rust,XMPPwocky/rust,GBGamer/rust,pshc/rust,andars/rust,0x73/rust,mitsuhiko/rust,...
cb355bf7ad63d087a558c0509dfe350016dd35ba
src/test/compile-fail/issue-2123.rs
src/test/compile-fail/issue-2123.rs
// xfail-test // error-pattern:unresolved import: m::f use x = m::f; mod m { #[legacy_exports]; } fn main() { }
use x = m::f; //~ ERROR failed to resolve import mod m { #[legacy_exports]; } fn main() { }
Update error message and un-xfail test
Update error message and un-xfail test
Rust
apache-2.0
bluss/rand,l0kod/rust,zaeleus/rust,defuz/rust,0x73/rust,pczarn/rust,hauleth/rust,erickt/rust,P1start/rust,defuz/rust,zubron/rust,jashank/rust,jashank/rust,miniupnp/rust,quornian/rust,aidancully/rust,stepancheg/rust-ide-rust,rohitjoshi/rust,philyoon/rust,servo/rust,jashank/rust,dwillmer/rust,richo/rust,l0kod/rust,zaeleu...
9968ccfc303f6cc6fed614118400faabcb9a6760
src/test/run-pass/clone-with-exterior.rs
src/test/run-pass/clone-with-exterior.rs
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Update old xfailing spawn/bind/join test
Update old xfailing spawn/bind/join test
Rust
apache-2.0
stepancheg/rust-ide-rust,LeoTestard/rust,bluss/rand,ebfull/rust,kmcallister/rust,ruud-v-a/rust,aidancully/rust,mahkoh/rust,mdinger/rust,avdi/rust,victorvde/rust,robertg/rust,graydon/rust,vhbit/rust,ejjeong/rust,mitsuhiko/rust,andars/rust,sarojaba/rust-doc-korean,zubron/rust,pshc/rust,andars/rust,jroesch/rust,j16r/rust,...
e9a991e866b5882b01f173792bd9812b2959323a
src/playpen.rs
src/playpen.rs
pub fn editor(source: &str) -> String { format!("<div id=\"active-code\"> <button class=\"btn btn-primary\" type=\"button\" id=\"run-code\">Run</button> <button class=\"btn btn-primary\" type=\"button\" id=\"reset-code\">Reset</button> <div id=\"editor\">{}</div> <div id=\"result\"></div> </div>", escape(source)) }...
pub fn editor(source: &str) -> String { format!("<div id=\"active-code\"> <button class=\"btn btn-primary\" type=\"button\" id=\"run-code\">Run</button> <button class=\"btn btn-primary\" type=\"button\" id=\"reset-code\">Reset</button> <div id=\"editor\">{}</div> <div id=\"result\"></div> </div>", escape(source)) }...
Allow '$' in rust files
Allow '$' in rust files
Rust
apache-2.0
kteza1/rust-by-example,beni55/rust-by-example,rwaldron/rust-by-example,mdinger/rust-by-example,MatejLach/rust-by-example,chriskrycho/rust-by-example,aakloxu/rust-by-example-cn,realcr/rust-by-example,nodakai/rust-by-example,jinyuanxie/rust-by-example-cn,aakloxu/rust-by-example-cn,DenisKolodin/rust-by-example,youprofit/r...
f88f660af4706e11b2c9753334b783ca501a3b86
src/test/run-pass/issue-38987.rs
src/test/run-pass/issue-38987.rs
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Fix stage 0 and 1 tests broken because i128 doesn't work in stages less than 2
Fix stage 0 and 1 tests broken because i128 doesn't work in stages less than 2 Broken by https://github.com/rust-lang/rust/pull/38992.
Rust
apache-2.0
graydon/rust,aidancully/rust,GBGamer/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust
9a1a1e22c210acb426013567d97ca56bb6c73c82
libimagentryview/src/lib.rs
libimagentryview/src/lib.rs
// // imag - the personal information management suite for the commandline // Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the ...
// // imag - the personal information management suite for the commandline // Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the ...
Remove unused import of log crate
Remove unused import of log crate
Rust
lgpl-2.1
mario-kr/imag,matthiasbeyer/imag,mario-kr/imag,matthiasbeyer/imag
2db84f95994e329cd591b78db88d1ca2d51177f8
filesystem/apps/example/main.rs
filesystem/apps/example/main.rs
use std::fs::File; use std::io::{Read, Write}; use system::scheme::{Packet, Scheme}; extern crate system; struct ExampleScheme; impl Scheme for ExampleScheme { } fn main() { //In order to handle example:, we create :example let mut scheme = File::create(":example").unwrap(); loop { let mut packet ...
use std::fs::File; use std::io::{Read, Write}; use system::error::{Error, Result, ENOENT, EBADF}; use system::scheme::{Packet, Scheme}; extern crate system; struct ExampleScheme; impl Scheme for ExampleScheme { fn open(&mut self, path: &str, flags: usize, mode: usize) -> Result { println!("open {:X} = {...
Implement tests for syscalls in example scheme
WIP: Implement tests for syscalls in example scheme
Rust
mit
nxnfufunezn/redox,tedsta/redox,imp/redox,nxnfufunezn/redox,nounoursheureux/redox,achanda/redox,vvlevchenko/redox,imp/redox,tedsta/redox,vvlevchenko/redox,tedsta/redox,nxnfufunezn/redox,achanda/redox,nounoursheureux/redox,vvlevchenko/redox,imp/redox,nounoursheureux/redox,achanda/redox,tedsta/redox
935442babcf4f8ae52c1a13bb9ce07270a302886
src/test/run-pass/syntax-extension.rs
src/test/run-pass/syntax-extension.rs
fn main() { auto s = #shell { uname -a && hg identify }; log s; }
fn main() { auto s = #shell { uname -a }; log s; }
Fix hg dependency in testsuite.
Fix hg dependency in testsuite.
Rust
apache-2.0
ktossell/rust,mitsuhiko/rust,XMPPwocky/rust,bombless/rust-docs-chinese,P1start/rust,zachwick/rust,krzysz00/rust,erickt/rust,kwantam/rust,stepancheg/rust-ide-rust,P1start/rust,stepancheg/rust-ide-rust,zubron/rust,reem/rust,mdinger/rust,aneeshusa/rust,rohitjoshi/rust,ejjeong/rust,avdi/rust,barosl/rust,SiegeLord/rust,vhbi...
431cb9a3454fe19fe6987aebb3b3655dc9eca8ad
src/test/run-pass/anon-obj-overriding.rs
src/test/run-pass/anon-obj-overriding.rs
//xfail-stage0 use std; fn main() { obj a() { fn foo() -> int { ret 2; } fn bar() -> int { ret self.foo(); } } auto my_a = a(); // An anonymous object that overloads the 'foo' method. auto my_b = obj() { fn foo() -> int { ...
//xfail-stage0 use std; fn main() { obj a() { fn foo() -> int { ret 2; } fn bar() -> int { ret self.foo(); } } auto my_a = a(); // An anonymous object that overloads the 'foo' method. auto my_b = obj() { fn foo() -> int { ...
Test method overriding a little more.
Test method overriding a little more.
Rust
apache-2.0
seanrivera/rust,l0kod/rust,pshc/rust,XMPPwocky/rust,kmcallister/rust,LeoTestard/rust,ejjeong/rust,aepsil0n/rust,ruud-v-a/rust,mdinger/rust,robertg/rust,SiegeLord/rust,stepancheg/rust-ide-rust,GrahamDennis/rand,stepancheg/rust-ide-rust,cllns/rust,gifnksm/rust,carols10cents/rust,P1start/rust,victorvde/rust,reem/rust,gray...
9029416e287e663bd6a1f48727509872669853c0
src/test/run-pass/lots-a-fail.rs
src/test/run-pass/lots-a-fail.rs
// FIXME: Importing std::task doesn't work under check-fast?! use std; import std::task; import std::comm; import std::uint; fn die() { fail; } fn iloop() { task::unsupervise(); let f = die; task::spawn(f); } fn main() { for each i in uint::range(0u, 100u) { let f = iloop; task::s...
// xfail-fast use std; import std::task; import std::comm; import std::uint; fn die() { fail; } fn iloop() { task::unsupervise(); let f = die; task::spawn(f); } fn main() { for each i in uint::range(0u, 100u) { let f = iloop; task::spawn(f); } }
Tweak random thing to make windows build succeed. Awesome.
Tweak random thing to make windows build succeed. Awesome. So, a recent commit made syntax-extension-fmt fail under check-fast. This commit disables lots-a-fail under check-fast and voila! *grumble*
Rust
apache-2.0
kimroen/rust,philyoon/rust,emk/rust,fabricedesre/rust,reem/rust,seanrivera/rust,jroesch/rust,seanrivera/rust,carols10cents/rust,jroesch/rust,zubron/rust,Ryman/rust,zachwick/rust,zaeleus/rust,KokaKiwi/rust,vhbit/rust,graydon/rust,SiegeLord/rust,kimroen/rust,mihneadb/rust,zaeleus/rust,ebfull/rust,pelmers/rust,barosl/rust...
f5505d185ccb9b1d84e6d7cdab20f901a778a86c
src/test/compile-fail/underscore-lifetime-binders.rs
src/test/compile-fail/underscore-lifetime-binders.rs
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Add tests for underscore lifetimes in impl headers and struct definitions
Add tests for underscore lifetimes in impl headers and struct definitions
Rust
apache-2.0
graydon/rust,aidancully/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust
129fa2e0c5a8d0d5117b64741034afd8a42c163a
src/conn/futures/prep_exec.rs
src/conn/futures/prep_exec.rs
use conn::Conn; use conn::futures::query_result::BinQueryResult; use conn::futures::Prepare; use conn::stmt::futures::Execute; use conn::stmt::Stmt; use errors::*; use lib_futures::Async; use lib_futures::Async::Ready; use lib_futures::Future; use lib_futures::Poll; use value::Params; enum Step { Prepare(Prepare)...
use conn::Conn; use conn::futures::query_result::BinQueryResult; use conn::futures::Prepare; use conn::stmt::futures::Execute; use errors::*; use lib_futures::Async; use lib_futures::Async::Ready; use lib_futures::Future; use lib_futures::Poll; use std::mem; use value::Params; steps! { PrepExec { Prepare(...
Use steps! for PrepExec future
Use steps! for PrepExec future
Rust
apache-2.0
blackbeam/mysql_async
7976e3654400a53fc9ef98cda19769fabd57b846
src/test/compile-fail/coherence-default-trait-impl.rs
src/test/compile-fail/coherence-default-trait-impl.rs
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Adjust test for new overlap message on default trait impls
Adjust test for new overlap message on default trait impls
Rust
apache-2.0
graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust
f2a38094222b15580170ef4c486a32d6e620a628
src/future/either.rs
src/future/either.rs
use {Future, Poll}; /// Combines two different futures yielding the same item and error /// types into a single type. pub enum Either<A, B> { /// First branch of the type A(A), /// Second branch of the type B(B), } impl<A, B, Item, Error> Future for Either<A, B> where A: Future<Item = Item, Error =...
use {Future, Poll}; /// Combines two different futures yielding the same item and error /// types into a single type. pub enum Either<A, B> { /// First branch of the type A(A), /// Second branch of the type B(B), } impl<A, B> Future for Either<A, B> where A: Future, B: Future<Item = A::I...
Use fewer generics in the Either impl
Use fewer generics in the Either impl
Rust
apache-2.0
Idolf/futures-rs,alexcrichton/futures-rs
1d55a5778bc5f0ab1cac0e9f12dcc2f04ddda719
src/rusti/wrapper.rs
src/rusti/wrapper.rs
#[legacy_modes]; #[legacy_exports]; #[allow(ctypes)]; #[allow(heap_memory)]; #[allow(implicit_copies)]; #[allow(managed_heap_memory)]; #[allow(non_camel_case_types)]; #[allow(non_implicitly_copyable_typarams)]; #[allow(owned_heap_memory)]; #[allow(path_statement)]; #[allow(structural_records)]; #[allow(unrecognized_li...
#[allow(ctypes)]; #[allow(heap_memory)]; #[allow(implicit_copies)]; #[allow(managed_heap_memory)]; #[allow(non_camel_case_types)]; #[allow(non_implicitly_copyable_typarams)]; #[allow(owned_heap_memory)]; #[allow(path_statement)]; #[allow(structural_records)]; #[allow(unrecognized_lint)]; #[allow(unused_imports)]; #[all...
Remove legacy modes and exports
rusti: Remove legacy modes and exports
Rust
apache-2.0
AerialX/rust,0x73/rust,vhbit/rust,untitaker/rust,SiegeLord/rust,l0kod/rust,pelmers/rust,pythonesque/rust,mdinger/rust,aepsil0n/rust,mdinger/rust,zaeleus/rust,avdi/rust,aidancully/rust,mvdnes/rust,SiegeLord/rust,jbclements/rust,mihneadb/rust,LeoTestard/rust,defuz/rust,rprichard/rust,gifnksm/rust,jroesch/rust,dwillmer/ru...
57685c7bdd0e1b5aed898e2e1fd509fb8d359f3e
kernel/common/parse_ip.rs
kernel/common/parse_ip.rs
/// Get the port from a string (ip) pub fn parse_port(string: &str) -> &str { let a = match string.find(':') { Some(pos) => pos + 1, None => 0, }; let mut b = 0; for c in string.chars().skip(a) { match c { '0' | '1' | '2' | '3' | '4' | '5' | ...
/// Get the port from a string (ip) pub fn parse_port(string: &str) -> &str { let a = match string.find(':') { Some(pos) => pos + 1, None => 0, }; let mut b = 0; for c in string.chars().skip(a) { match c { '0' | '1' | '2' | '3' | '4' | '5' | ...
Optimize parse_host. And it's carefully reviewed for not being panicable.
Optimize parse_host. And it's carefully reviewed for not being panicable.
Rust
mit
rexlunae/redox,rexlunae/redox,Lacaranian/redox,Lacaranian/redox,Lacaranian/redox,Lacaranian/redox,Lacaranian/redox,rexlunae/redox
9f16c2ce59ac942e1c0415987012100756a44039
src/test/compile-fail/coherence-cross-crate-conflict.rs
src/test/compile-fail/coherence-cross-crate-conflict.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Adjust coherence test to reflect that only the orphan rule prevents you from adding *generalizing* impls
Adjust coherence test to reflect that only the orphan rule prevents you from adding *generalizing* impls
Rust
apache-2.0
aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust
5974e5b294ee3b67054a31eae2a4b9bab950a119
src/test/compile-fail/issue-14091.rs
src/test/compile-fail/issue-14091.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Fix up error-pattern style test
Fix up error-pattern style test
Rust
apache-2.0
GBGamer/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,GBGamer/rust,aidancully/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust
45fd7cd3592d4cc400cbb3d47e869814de98220c
src/test/compile-fail/pat-range-bad-dots.rs
src/test/compile-fail/pat-range-bad-dots.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Enable a test for .. in range patterns.
Enable a test for .. in range patterns.
Rust
apache-2.0
victorvde/rust,vhbit/rust,zubron/rust,pshc/rust,rohitjoshi/rust,l0kod/rust,zubron/rust,ejjeong/rust,richo/rust,mahkoh/rust,pshc/rust,AerialX/rust,dwillmer/rust,nwin/rust,ruud-v-a/rust,kimroen/rust,kwantam/rust,omasanori/rust,mdinger/rust,miniupnp/rust,mdinger/rust,defuz/rust,mvdnes/rust,emk/rust,aepsil0n/rust,l0kod/rus...
bad4869d28594da7daa1e9a3b7dffc958e1ecb2d
src/test/compile-fail/bad-format-args.rs
src/test/compile-fail/bad-format-args.rs
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Fix touchy test to work with old and new error format
Fix touchy test to work with old and new error format
Rust
apache-2.0
aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust
f2e73d9d48dec8ae3103ba46a35586a2a5435a4f
src/test/compile-fail/method-suggestion-no-duplication.rs
src/test/compile-fail/method-suggestion-no-duplication.rs
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Fix compile-fail test for `ExactSizeIterator::is_empty`
Fix compile-fail test for `ExactSizeIterator::is_empty`
Rust
apache-2.0
GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust
c4313d8e98fc100d5f7729adaec1af4262607355
src/future/fuse.rs
src/future/fuse.rs
use {Future, Poll, Async}; /// A future which "fuse"s a future once it's been resolved. /// /// Normally futures can behave unpredictable once they're used after a future /// has been resolved, but `Fuse` is always defined to return `Async::NotReady` /// from `poll` after it has succeeded, and after it has succeeded a...
use {Future, Poll, Async}; /// A future which "fuses" a future once it's been resolved. /// /// Normally futures can behave unpredictable once they're used after a future /// has been resolved, but `Fuse` is always defined to return `Async::NotReady` /// from `poll` after it has resolved successfully or returned an er...
Tweak `Fuse` docs: remove reference to `schedule`
Tweak `Fuse` docs: remove reference to `schedule` * Also clarify that the `Fuse` future is construstructed by the `Future::fuse` method
Rust
apache-2.0
alexcrichton/futures-rs,Idolf/futures-rs
f1a67dba10f3c1e56aff11206443533ecfedc90c
src/module.rs
src/module.rs
use runtime::Runtime; use error::ImagError; use error::ImagErrorBase; pub struct ModuleError { base: ImagErrorBase, module_name: String, } impl ModuleError { pub fn short<T: Module>(module : &T, short : String) -> ModuleError { ModuleError::new(module, short, "".to_string()) } pub fn new...
use runtime::Runtime; use error::ImagErrorBase; pub struct ModuleError { base: ImagErrorBase, module_name: String, } impl ModuleError { pub fn short<T: Module>(module : &T, short : String) -> ModuleError { ModuleError::new(module, short, "".to_string()) } pub fn new<T: Module>(module : &...
Revert "Add: impl ImagError for ModuleError"
Revert "Add: impl ImagError for ModuleError" This reverts commit 7b1f9cfbac1ee6c77405a6c06251873b5480f8c8.
Rust
lgpl-2.1
mario-kr/imag,mario-kr/imag,matthiasbeyer/imag,matthiasbeyer/imag
d1c52ac0c9d8d9f61c9b77261ed17f50f4d1eb96
src/lib.rs
src/lib.rs
#![cfg(any(target_arch="x86", target_arch="x86_64"))] #![no_std] #![crate_name="cpu"] #![crate_type="rlib"] #![feature(no_std)] #![feature(asm)] #![feature(core)] #![feature(hash)] #[macro_use] extern crate core; #[macro_use] extern crate bitflags; pub use cpu::*; #[cfg(target_arch="x86")] #[path = "x86.rs"] mod cp...
#![cfg(any(target_arch="x86", target_arch="x86_64"))] #![no_std] #![crate_name="cpu"] #![crate_type="rlib"] #![feature(no_std)] #![feature(asm)] #![feature(core)] #[macro_use] extern crate core; #[macro_use] extern crate bitflags; pub use cpu::*; #[cfg(target_arch="x86")] #[path = "x86.rs"] mod cpu; #[cfg(target_ar...
Remove the now-unused hash feature gate
Remove the now-unused hash feature gate
Rust
mit
phil-opp/rust-x86_64,gz/rust-x86,gz/rust-x86,RustOS-Fork-Holding-Ground/libcpu,rexlunae/redox,rexlunae/redox,rexlunae/redox,Tobba/libcpu
7939ea0b015b999f2ee85f07f6ac808dba788d73
src/fuse.rs
src/fuse.rs
use std::sync::Arc; use {Future, Wake, Tokens}; /// A future which "fuse"s an future once it's been resolved. /// /// Normally futures can behave unpredictable once they're used after a future /// has been resolved, but `Fuse` is always defined to return `None` from `poll` /// after it has succeeded, and after it has...
use std::sync::Arc; use {Future, Wake, Tokens}; /// A future which "fuse"s an future once it's been resolved. /// /// Normally futures can behave unpredictable once they're used after a future /// has been resolved, but `Fuse` is always defined to return `None` from `poll` /// after it has succeeded, and after it has...
Drop the future early in Fuse
Drop the future early in Fuse
Rust
apache-2.0
Idolf/futures-rs,alexcrichton/futures-rs
0ddc17d5bb6757dc49136c0de3168d9cdb00f6e3
src/test/compile-fail/issue-30580.rs
src/test/compile-fail/issue-30580.rs
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Add comment explaining purpose of test
Add comment explaining purpose of test
Rust
apache-2.0
aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,GBGamer/rust
751449837148d80177c43a6bc7075dcb7c8b08eb
filesystem/apps/example/main.rs
filesystem/apps/example/main.rs
use std::fs::File; use std::io::{Read, Write}; use system::scheme::{Packet, Scheme}; extern crate system; struct ExampleScheme; impl Scheme for ExampleScheme { } fn main() { //In order to handle example:, we create :example let mut scheme = File::create(":example").unwrap(); loop { let mut packet ...
use std::fs::File; use std::io::{Read, Write}; use system::error::{Error, Result, ENOENT, EBADF}; use system::scheme::{Packet, Scheme}; extern crate system; struct ExampleScheme; impl Scheme for ExampleScheme { fn open(&mut self, path: &str, flags: usize, mode: usize) -> Result { println!("open {:X} = {...
Implement tests for syscalls in example scheme
WIP: Implement tests for syscalls in example scheme
Rust
mit
Lacaranian/redox,rexlunae/redox,Lacaranian/redox,Lacaranian/redox,Lacaranian/redox,rexlunae/redox,rexlunae/redox,Lacaranian/redox
5f1c6a0076d97c4893b852a71a073ae7a6fa3c6b
src/test/compile-fail/issue-23024.rs
src/test/compile-fail/issue-23024.rs
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
Remove the NOTE tests for now. We'll move to UI tests later
Remove the NOTE tests for now. We'll move to UI tests later
Rust
apache-2.0
graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust
25694dd866e2d6b84e4bbe4b36d90bef72a2a08a
diceware-rust/src/lib.rs
diceware-rust/src/lib.rs
use rand::seq::SliceRandom; extern crate phf; // build.rs produces a codegen.rs file defining WORDLIST: // static WORDLIST: phf::Map<&str,&str> include!(concat!(env!("OUT_DIR"), "/codegen.rs")); pub fn get_word(roll: &str) -> Option<String> { WORDLIST.get(roll).map(|s| s.to_string()) } pub fn roll() -> String {...
use rand::Rng; extern crate phf; // build.rs produces a codegen.rs file defining WORDLIST: // static WORDLIST: phf::Map<&str,&str> include!(concat!(env!("OUT_DIR"), "/codegen.rs")); pub fn get_word(roll: &str) -> Option<String> { WORDLIST.get(roll).map(|s| s.to_string()) } pub fn roll() -> String { let mut ...
Adjust RNG style of rolls.
Adjust RNG style of rolls.
Rust
mit
jacobmorzinski/diceware,jacobmorzinski/diceware,jacobmorzinski/diceware
3c19e53ad1ff1808dc9e3d41ca88c8d1eb5f38f9
macro/src/namespace.rs
macro/src/namespace.rs
use crate::syntax::ident; use std::fmt::{self, Display}; use syn::parse::{Parse, ParseStream, Result}; use syn::{Path, Token}; mod kw { syn::custom_keyword!(namespace); } pub struct Namespace { segments: Vec<String>, } impl Parse for Namespace { fn parse(input: ParseStream) -> Result<Self> { let ...
use crate::syntax::ident; use quote::IdentFragment; use std::fmt::{self, Display}; use syn::parse::{Parse, ParseStream, Result}; use syn::{Path, Token}; mod kw { syn::custom_keyword!(namespace); } pub struct Namespace { segments: Vec<String>, } impl Parse for Namespace { fn parse(input: ParseStream) -> R...
Enable Namespace to be used in format_ident
Enable Namespace to be used in format_ident
Rust
apache-2.0
dtolnay/cxx,dtolnay/cxx,dtolnay/cxx,dtolnay/cxx
b304960c7cd56267c043b5e7a3fe01974f9b84a3
src/notification.rs
src/notification.rs
use gobject::GObject; use libc::c_char; use glib::GError; #[repr(C)] struct NotifyNotificationPrivate; #[repr(C)] pub struct NotifyNotification { _parent_object: GObject, _priv_: NotifyNotificationPrivate } extern "C" { pub fn notify_notification_new(summary: *const c_char, ...
use gobject::GObject; use libc::c_char; use glib::GError; enum NotifyNotificationPrivate {} #[repr(C)] pub struct NotifyNotification { _parent_object: GObject, _priv_: NotifyNotificationPrivate } extern "C" { pub fn notify_notification_new(summary: *const c_char, body: ...
Use a zero-variant enum instead of a zero-sized struct for representing opaque structs
Use a zero-variant enum instead of a zero-sized struct for representing opaque structs
Rust
mit
crumblingstatue/rust-libnotify-sys
c25a5573a084f1d0822cb3bf373191d560565db6
communicator/src/lib.rs
communicator/src/lib.rs
pub mod client; pub mod network; #[cfg(test)] mod tests { #[test] fn it_works() { } }
pub mod client; pub mod network; #[cfg(test)] mod tests { use super::client; #[test] fn it_works() { client::connect(); } }
Add example usage of super in tests
Add example usage of super in tests
Rust
mit
pgrzesik/learning-rust
4e6b2fce221b8d702d7d2caaf40aeaed9de2fe80
rust/leap/src/lib.rs
rust/leap/src/lib.rs
pub fn is_leap_year(year: isize) -> bool { (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) }
pub fn is_leap_year(year: isize) -> bool { (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0) }
Test the simple case first
Test the simple case first It should be better
Rust
bsd-2-clause
gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism
124813eb95aec39844e1c7c723254a0da7962b14
src/contentlength.rs
src/contentlength.rs
use hyper::header::{ContentLength, Headers}; use std::ops::Deref; use Byte; /// Trait to extend functionalities of the Headers type, from `hyper` pub trait GetContentLength { /// Function to get the content length of a remote document. /// The returned type is `Byte`. fn get_content_length(&self) -> Optio...
use hyper::header::{ContentLength, Headers}; use std::ops::Deref; use Bytes; /// Trait to extend functionalities of the Headers type, from `hyper` pub trait GetContentLength { /// Function to get the content length of a remote document. /// The returned type is `Option<Bytes>`. fn get_content_length(&self...
Update Byte type to Bytes
Update Byte type to Bytes
Rust
mit
derniercri/snatch
e55710d8c26b8531126e0d69708345da090342dd
benches/vm.rs
benches/vm.rs
#![feature(test)] extern crate test; extern crate base; extern crate parser; extern crate check; extern crate vm; use std::fs::File; use std::io::Read; use base::symbol::SymbolModule; use check::typecheck::Typecheck; use vm::vm::VM; #[bench] fn prelude(b: &mut ::test::Bencher) { let vm = VM::new(); let env...
#![feature(test)] extern crate test; extern crate base; extern crate parser; extern crate check; extern crate vm; use std::fs::File; use std::io::Read; use base::symbol::SymbolModule; use check::typecheck::Typecheck; use vm::vm::VM; #[bench] fn prelude(b: &mut ::test::Bencher) { let vm = VM::new(); let env...
Fix the compilation of benchmarks
fix: Fix the compilation of benchmarks
Rust
mit
gluon-lang/gluon,Marwes/embed_lang,gluon-lang/gluon,Marwes/gluon,Marwes/embed_lang,Marwes/gluon
0119058ec28c5b65ff2a863c1dbfd59a7d258e48
src/lib.rs
src/lib.rs
extern crate ascii; mod pascal_str; mod pascal_string; const PASCAL_STRING_BUF_SIZE: usize = 255; pub use pascal_str::{Chars, CharsMut, PascalStr}; pub use pascal_string::{PascalString, PascalStringAppendError, PascalStringCreateError}; #[cfg(test)] mod tests { use super::*; use ascii::*; #[test] fn...
extern crate ascii; mod pascal_str; mod pascal_string; const PASCAL_STRING_BUF_SIZE: usize = 255; pub use pascal_str::{Chars, CharsMut, PascalStr}; pub use pascal_string::{PascalString, PascalStringAppendError, PascalStringCreateError}; #[cfg(test)] mod tests { use super::*; use ascii::*; #[test] fn...
Add a test for string append
Add a test for string append
Rust
mit
burtonageo/pascal_string
c2c8e4325dec929af86222e30715f67fdcbf0478
src/main.rs
src/main.rs
use std::env; fn multiply (a: f32, b: f32) -> f32 { return a * b; } fn add (a: f32, b: f32) -> f32 { return a + b; } fn divide (a: f32, b: f32) -> f32 { return a / b; } fn subtract (a: f32, b: f32) -> f32 { return a - b; } fn exponent (a: f32, b: f32) -> f32 { return a.powf(b); } fn main () { ...
use std::env; use std::collections::HashMap; struct Operator { precedence: i32, func: Box<Fn(f32, f32) -> f32> } fn main () { let args: Vec<_> = env::args().collect(); let tokens: Vec<&str> = args[1].split(" ").collect(); let mut output: Vec<i32> = vec![]; let mut operator: Vec<_> = vec![]; ...
Change how we do operators
Change how we do operators
Rust
mit
adamjc/rust_calc
4df9586e376a1ebc873158e27d28c434de7ae6fe
glsl-to-spirv/build/build.rs
glsl-to-spirv/build/build.rs
use std::env; use std::fs; use std::path::Path; fn main() { println!("cargo:rerun-if-changed=build/glslangValidator"); println!("cargo:rerun-if-changed=build/glslangValidator.exe"); let target = env::var("TARGET").unwrap(); let out_file = Path::new(&env::var("OUT_DIR").unwrap()).join("glslang_validato...
use std::env; use std::fs; use std::fs::Permissions; use std::path::Path; fn main() { println!("cargo:rerun-if-changed=build/glslangValidator"); println!("cargo:rerun-if-changed=build/glslangValidator.exe"); let target = env::var("TARGET").unwrap(); let out_file = Path::new(&env::var("OUT_DIR").unwrap...
Set the proper permissions of the executable for glsl-to-spirv
Set the proper permissions of the executable for glsl-to-spirv
Rust
apache-2.0
vulkano-rs/vulkano
82e1c5672a2e1ab101bbd672cce61b6ebe9841f8
src/net/eth/extractor.rs
src/net/eth/extractor.rs
//! Implementation of Ethernet related Extractors use net::Packet; use net::defs::{Rule, EtherType}; use net::conn::filter::Extractor; use super::defs::Header; /// Type responsible for ether type extraction pub struct EtherTypeExtractor; impl Extractor<EtherType> for EtherTypeExtractor { /// Extract the ether...
//! Implementation of Ethernet related Extractors use net::Packet; use net::defs::{Rule, HwAddr, EtherType}; use net::conn::filter::Extractor; use super::defs::Header; /// Type responsible for ether type extraction pub struct EtherTypeExtractor; impl Extractor<EtherType> for EtherTypeExtractor { /// Extract t...
Add definition of type SourceHwExtractor
net/eth: Add definition of type SourceHwExtractor
Rust
mit
uni-rs/uni.rs
9800a5ab6499a7d3488fc4db49d92b5f156b3940
testing/tests/simple.rs
testing/tests/simple.rs
#![feature(proc_macro)] #[macro_use] extern crate askama_derive; extern crate askama; use askama::Template; #[derive(Template)] #[template(path = "simple.html")] struct TestTemplate { strvar: String, num: i64, i18n: String, } #[test] fn it_works() { let s = TestTemplate { strvar: "foo".to_st...
#![feature(proc_macro)] #[macro_use] extern crate askama_derive; extern crate askama; use askama::Template; #[derive(Template)] #[template(path = "simple.html")] struct VariablesTemplate { strvar: String, num: i64, i18n: String, } #[test] fn test_variables() { let s = VariablesTemplate { str...
Rename it_works() test function to test_variables()
Rename it_works() test function to test_variables()
Rust
apache-2.0
djc/askama,djc/askama,djc/askama
6ee768244b39680600e83deaa725afe20a666729
src/main.rs
src/main.rs
use std::io; use std::io::Write; // need it to flush stdout static PROMPT: &'static str = "$ "; fn execute(cmd: &String) { println!("you entered [{}]", cmd); } fn main() { // we allocate a String for the user input let mut input: String = String::new(); loop { print!("{}", PROMPT); ...
use std::io; use std::io::Write; // need it to flush stdout use std::process; static PROMPT: &'static str = "$ "; fn execute(cmd: &String) { let ret = process::Command::new(cmd).output().unwrap(); println!("{}", String::from_utf8_lossy(&ret.stdout).trim()); } fn main() { // we allocate a String for the ...
Add executation of single commands
Add executation of single commands - no arguments allowed - breaks on Ctrl-d, exits on Ctrl-c
Rust
mit
mossberg/relish
bb9bf4c60ab9bff0ef8fb92cd483439efa7bc15d
src/main.rs
src/main.rs
extern crate capnp; extern crate chrono; #[macro_use] extern crate clap; #[cfg(feature = "coroutines")] extern crate coio; extern crate flate2; #[cfg(not(feature = "without_kafka"))] extern crate kafka; extern crate log; extern crate openssl; extern crate rand; extern crate redis; extern crate serde; extern crate serde...
extern crate capnp; extern crate chrono; #[macro_use] extern crate clap; #[cfg(feature = "coroutines")] extern crate coio; extern crate flate2; #[cfg(not(feature = "without_kafka"))] extern crate kafka; extern crate log; extern crate openssl; extern crate rand; extern crate redis; extern crate serde; extern crate serde...
Print the original version string to stderr, not stdout
Print the original version string to stderr, not stdout This is required to avoid interfering with stdout being used for the output stream.
Rust
unknown
jedisct1/flowgger,jedisct1/flowgger,jedisct1/zok,jedisct1/zok
a41d87d2791d588ea6efd08d2075fb407d7c2881
src/main.rs
src/main.rs
#![no_std] #![no_main] use daedalos::println; #[no_mangle] pub extern "C" fn _start() -> ! { println!("Hello, world!"); loop {} } #[cfg(not(test))] use core::panic::PanicInfo; #[cfg(not(test))] #[panic_handler] fn panic(info: &PanicInfo) -> ! { println!("{}", info); loop {} }
#![no_std] #![no_main] #[cfg(not(test))] use daedalos::println; #[cfg(not(test))] #[no_mangle] pub extern "C" fn _start() -> ! { println!("Hello, world!"); loop {} } #[cfg(not(test))] use core::panic::PanicInfo; #[cfg(not(test))] #[panic_handler] fn panic(info: &PanicInfo) -> ! { println!("{}", info); ...
Remove start when running tests
Remove start when running tests
Rust
bsd-3-clause
bemeurer/daedalos
eaca4fada0fbdff98381afbc610bb8f850f33e79
src/main.rs
src/main.rs
extern crate ast; use ast::Evaluate; fn main() { let program: ast::Program = ast::Program::If( ast::Condition::Less( Box::new(ast::Expression::Sensor(ast::Sensor::Vx)), Box::new(ast::Expression::Multiply( Box::new(ast::Expression::Constant(2.0)), Box::new(ast::Expression::Constant(3.0)) )) ), ...
extern crate ast; use ast::Evaluate; use ast::Program::{If,Command}; use ast::Condition::Less; use ast::Expression::{Sensor,Multiply,Constant}; fn main() { let program: ast::Program = If( Less( Box::new(Sensor(ast::Sensor::Vx)), Box::new(Multiply( Box::new(Constant(2.0)), Box::new(Constant(3.0)) ...
Use `use` to remove some language noise
Use `use` to remove some language noise
Rust
mit
darwins-challenge/moonlander-ast-rust,darwins-challenge/moonlander-ast-rust
1eec0d483477393f8dfbd2eab70ffadad0a5e624
src/misc.rs
src/misc.rs
use std::ops::{ RangeFull, RangeFrom, RangeTo, Range, }; /// **RangeArgument** is implemented by Rust's built-in range types, produced /// by range syntax like `..`, `a..`, `..b` or `c..d`. pub trait RangeArgument { #[doc(hidden)] /// Start index (inclusive) fn start(&self) -> Option<usize>...
use std::ops::{ RangeFull, RangeFrom, RangeTo, Range, }; /// **RangeArgument** is implemented by Rust's built-in range types, produced /// by range syntax like `..`, `a..`, `..b` or `c..d`. pub trait RangeArgument { #[inline] #[doc(hidden)] /// Start index (inclusive) fn start(&self) ->...
Make sure the methods on RangeArgument can be inlined
Make sure the methods on RangeArgument can be inlined
Rust
apache-2.0
Stebalien/arrayvec,tbu-/arrayvec,bluss/arrayvec
2c168be2e74115730acce90a8a177d98eae7758f
src/index.rs
src/index.rs
struct Index { path: String, entries: Vec<String>, } impl Index { fn new(path: &str) -> Index { return Index { path: path.to_string(), entries: vec![] } } } #[test] fn new_creates_index_with_passed_path() { let path = "my path"; let index = Index::new(path); assert!(index.path == p...
struct Index { path: Path, entries: Vec<Path>, } impl Index { fn new(path: &str) -> Index { return Index { path: Path::new(path.to_string()), entries: vec![] } } } #[test] fn new_creates_index_with_passed_path() { let path = "my path"; let index = Index::new(path); // Get the inde...
Update Index struct to use Path objects instead of strings.
Update Index struct to use Path objects instead of strings.
Rust
mit
jmacdonald/bloodhound
c3cd7e65006f0018879ef1763977e579ae682c97
src/serial_support/common.rs
src/serial_support/common.rs
use std::thread; use std::sync::mpsc::channel; use std::sync::mpsc::Sender; use std::sync::mpsc::Receiver; /// Create a bidirectional channel /// Returns two sender-receiver channel pairs /// One pair should be given to one thread /// and the other pair to another thread pub fn bichannel<T>() -> ((Sender<T>,Receiver<T...
use std::sync::mpsc::channel; use std::sync::mpsc::Sender; use std::sync::mpsc::Receiver; /// Create a bidirectional channel /// Returns two sender-receiver channel pairs /// One pair should be given to one thread /// and the other pair to another thread pub fn bichannel<T, U>() -> ((Sender<T>, Receiver<U>), (Sender<U...
Allow two way channel to have two different types
Allow two way channel to have two different types
Rust
apache-2.0
DanielJoyce/websocket-serial-server,DanielJoyce/websocket-serial-server