messages
listlengths
2
2
language
stringclasses
8 values
prompt_type
stringclasses
2 values
lint_errors
int64
0
129
⌀
cyclomatic_complexity
int64
0
32
⌀
license
stringclasses
7 values
commit
stringlengths
40
40
repos
stringlengths
5
116k
new_file
stringlengths
4
220
status
stringclasses
6 values
error
stringlengths
26
74
⌀
is_valid_syntax
bool
2 classes
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io;\nuse std::io::prelude::*;\n\nfn main() {\n let stdin = io::stdin();\n for line in stdin.lock().lines() {\n println!(\"{}\", line.unwrap());\n }\n}\n\n```\n\nApply this change: Implement naïve solution (TODO: repla...
rust
edit
2
3
mit
ff9539503615362d6cddf0b13cafc1672adfb6a1
jmtuley/adventofcode2015
day2/solution/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate yoga;\n\nuse yoga::{Direction, Node, StyleUnit, Undefined};\n\n#[test]\nfn test_recalculate_resolved_dimension_onchange() {\n\tlet mut root = Node::new();\n\n\tlet mut root_child0 = Node::new();\n\troot_child0.set_min_height(Styl...
rust
edit
0
1
mit
88b5426279e4313e1d8887d79b036fb5048c36ff
bschwind/yoga-rs,bschwind/yoga-rs,bschwind/yoga-rs,bschwind/yoga-rs
tests/relayout_test.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::{BufReader, BufRead};\nuse std::fs::File;\nuse rand::Rng;\n\nconst K: usize = 10;\n\npub fn reservoir_sample<R: Rng>(f: File, mut rng: R) -> String {\n let reader = BufReader::new(f);\n\n let mut reservoir: [String;K] = Def...
rust
edit
0
4
mit
9ab052ae9a398090c48b4f9f4624bb6db93c5e84
jpypi/rustix
src/services/utils.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[cfg(feature = \"rand\")]\nuse crate::generate_localpart;\n\nopaque_identifier! {\n /// A Matrix key ID.\n ///\n /// Device identifiers in Matrix are completely opaque character sequences. This type is\n /// provided simply for i...
rust
edit
0
1
mit
b4226f882ba13a0f0162acdf8af38004d5e06203
ruma/ruma
crates/ruma-identifiers/src/device_id.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate serde;\nextern crate serde_json;\n\nuse hyper::Client;\nuse hyper::client::{Body, Response};\nuse hyper::header::Headers;\nuse hyper::status::StatusCode;\nuse jira_request::*;\nuse std::io::Read;\n\npub fn send<R: JIRARequest, T:...
rust
edit
0
4
mit
48e0f22fae27fd895b2c01c706d8255a7e63f0c3
dorayakikun/alfred_jira_workflow
src/jira_client.rs
rejected_duplicate
Near-duplicate of sample 119917
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Ensures that unicode characters are handled in the JSON output.\n\nfn main() {\n let foo = \"❤\";\n// ^^^WARN unused variable\n// ^^^NOTE(>=1.17.0) #[warn(unused_variables)]\n// ^^^NOTE(>=1.21.0,<1.22.0) to disable this w...
rust
edit
3
1
mit
3841af8071a45d0e1848de7a2a6ff74f04a3196d
rust-lang/sublime-rust,jhasse/sublime-rust,rust-lang/sublime-rust
tests/error-tests/tests/test_unicode.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::{File,fs};\nuse std::path::posix::Path;\nuse std::os::{homedir};\nuse std::rand::random;\n\npub fn new<'r>(name: &str) {\n let home_unwrap = homedir().unwrap();\n let path = format!(\"{}/.muxed/{}\", home_unwrap.display(), ...
rust
edit
0
1
mit
84656e28b5b514e894729460962edcda92289e9a
brianp/muxed,brianp/muxed
src/creator.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse gcc;\n\n#[cfg(windows)]\nfn main() { gcc::compile_library(\"libsid.a\", &[\"./src/obtain_sid.c\"]); }\n\n#[cfg(not(windows))]\nfn main() {}\n\n```\n\nApply this change: Fix platform-specific unused import warning\n\ngcc crate is only used...
rust
edit
0
1
apache-2.0
892a2aa6f3c36fca8e1527edd354374284301420
habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat
build.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Fix test that used an oversized int literal" }, { "role": "assistant", "content": "\n\nfn f<T>(i: @uint, t: T) { }\n\nfn main() { let x = bind f::<char>(@0xdeafbeefu, _); }\n" } ]
rust
new_file
null
null
apache-2.0
17e99ec57fe8b4b9de24933728db1737e846a7c2
0x73/rust,KokaKiwi/rust,pelmers/rust,robertg/rust,rprichard/rust,aneeshusa/rust,nwin/rust,victorvde/rust,servo/rust,sarojaba/rust-doc-korean,LeoTestard/rust,l0kod/rust,0x73/rust,servo/rust,carols10cents/rust,dinfuehr/rust,robertg/rust,aturon/rust,0x73/rust,defuz/rust,michaelballantyne/rust-gpu,krzysz00/rust,zubron/rust...
src/test/run-pass/drop-parametric-closure-with-bound-box.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Make me compile without changing the function signature! Scroll down for hints :)\n\nfn main() {\n let word = String::from(\"green\"); // Try not changing this line :)\n if is_a_color_word(word) {\n println!(\"That is a color ...
rust
edit
0
3
mit
e48efe3c34785ff8cead35e78e8c064e153cd403
ddevlin/rustlings,carols10cents/rustlings,carols10cents/rustlings
strings/strings2.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! This module shows an example of code generated by the macro. **IT MUST NOT BE USED OUTSIDE THIS\n//! CRATE**.\n\nbitflags! {\n /// This is the same `Flags` struct defined in the [crate level example](../index.html#example).\n /// No...
rust
edit
0
0
apache-2.0
ce6c4462aba101de546e6aa7d50780d35b652bc6
bitflags/bitflags,rust-lang/bitflags
src/example_generated.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::hash_map::HashMap;\nuse js_types::js_type::{JsType, JsT};\n\npub struct JsObj {\n proto: Option<Box<JsObj>>,\n dict: HashMap<JsType, JsType>,\n}\n\nimpl JsT for JsObj {}\n\nimpl JsObj {\n pub fn new() -> JsObj {...
rust
edit
1
1
mit
c6c719763ff934cfbf870b34f8835dd2b8599829
rustoscript/french-press
src/js_types/js_obj.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Highly optimised prime sieves.\n//!\n//! This is designed to be used via the `primal` crate.\n\n#![cfg_attr(feature = \"unstable\", feature(llvm_asm))]\n\n// black boxes for pointers; LLVM isn't so happy without\n// them. Unfortunately on...
rust
edit
2
1
apache-2.0
02361de23a3698d964dd36b1b792f8a9dbbc74ca
huonw/primal,cuviper/primal,cuviper/primal,huonw/primal
primal-sieve/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Implements http://rosettacode.org/wiki/Read_a_file_line_by_line\nuse std::io::fs::File;\nuse std::io::BufferedReader;\nuse std::os::args;\n\nfn main() {\n let filename = match args().len() {\n 1 => fail!(\"You must enter a filena...
rust
edit
0
3
unlicense
627621147877872f018c268f5d6b8235acd8721e
magum/rust-rosetta,magum/rust-rosetta,crespyl/rust-rosetta,Hoverbear/rust-rosetta,crr0004/rust-rosetta,ZoomRmc/rust-rosetta,JIghtuse/rust-rosetta,sakeven/rust-rosetta,pfalabella/rust-rosetta,ghotiphud/rust-rosetta
src/read_file_line.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate orbital;\n\npub use std::collections::VecDeque;\n\nmod editor;\npub use self::editor::*;\n\nmod parse;\npub use self::parse::*;\n\nmod key_state;\npub use self::key_state::*;\n\nmod key;\npub use self::key::*;\n\nmod prompt;\npub...
rust
edit
19
0
mit
c076c3b8f11d03102f36af49138dd70eb54543d8
redox-os/sodium
main.rs
rejected_lint
Too many lint violations: 19
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt::{Display, Formatter, Error};\n\nuse ast::Stmt;\n\n// For storing functions.\n// In the future, this will have to store some sense of local variable scope,\n// to deal with closures.\n#[derive(Clone, Debug)]\npub struct JsFnStruc...
rust
edit
null
null
mit
1cdf7023565d6f04f6a09db341ef2988a7dca305
rustoscript/js.rs-common
src/types/js_fn.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// run-pass\n\n#![allow(warnings)]\n\nuse std::iter::Zip;\n\nfn zip_covariant<'a, A, B>(iter: Zip<&'static A, &'static B>) -> Zip<&'a A, &'a B> { iter }\n\nfn main() { }\n\n```\n\nApply this change: Add a test to ensure Fuse stays covariant" ...
rust
edit
0
1
apache-2.0
a3344d1a3aef9d8c1171899fcd34486a7038a984
aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/ui/variance-iterators-in-libcore.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2016 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n//...
rust
edit
0
1
apache-2.0
b8c4e9c235db5f67129abdae8f336e06bf2bc8ba
GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,graydon/rust
src/test/run-fail/overflowing-pow-unsigned.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[link(name = \"wgfem\",\n vers = \"0.8\",\n url = \"https://github.com/scharris/WGFEM-Rust\")];\n\n#[license = \"MIT\"];\n#[crate_type = \"exe\"];\n#[feature(globs)];\n#[feature(macro_rules)];\n#[feature(link_args)];\n\nextern mod extra;\n...
rust
edit
null
null
mit
7b52f7ed0c03a1005a81db13e9f4f443b24fbe20
scharris/WGFEM-Rust,scharris/WGFEM-Rust,scharris/WGFEM-Rust
wgfem.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rs_release;\n\nuse rs_release::{get_os_release, parse_os_release};\nuse std::env;\n\nfn main() {\n let mut args = env::args();\n\n let os_release = if let Some(os_release_path) = args.nth(1) {\n parse_os_release(os_r...
rust
edit
0
6
mit
1a15e5c4627d32c40a8e28b5d090fbf7622100dd
JIghtuse/rs-release
examples/get_os_release.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse ::inflector::Inflector;\nuse ::syn::Ident;\nuse ::yaml_rust::Yaml;\n\nuse infer::method;\nuse infer::TokensResult;\n\nfn mod_ident(path: &str) -> Ident {\n Ident::new(path.replace('/', \" \").trim().to_snake_case())\n}\n\npub(super) fn...
rust
edit
0
3
mit
e8a9d0c9312b9d2349df931368f6080b8b7f7a8d
OJFord/tapioca
tapioca-derive/src/infer/path.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2016 Alexander Reece\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n/...
rust
edit
0
0
apache-2.0
e9ea1db3151fbbc1b234d7379f1228371570a395
alreece45/amqp-rs
amqp0/primitives/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// run-pass\n\n#![feature(generators, generator_trait)]\n\nuse std::ops::{Generator, GeneratorState};\n\nfn my_scenario() -> impl Generator<String, Yield = &'static str, Return = String> {\n |_arg: String| {\n let my_name = yield \"...
rust
edit
0
1
apache-2.0
3b6a5fbeceff5a8910c07c6115396e0420e29bee
graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/ui/generator/issue-69039.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! A reimplementation of dcmdump in Rust\n//! WIP\nextern crate dicom_core;\n\nuse dicom_core::{DicomElement, DicomObject};\nuse std::fs::File;\nuse std::path::Path;\n\nfn main() {\n println!(\"Sorry, this tool is not implemented yet.\");...
rust
edit
0
1
apache-2.0
428b457c5878261baef5311eb11198a45d12e111
Enet4/dicom-rs,Enet4/dicom-rs
core/examples/dcmdump.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Provides an interface for dealing with FLAC metadata blocks.\n\nmod types;\nmod parser;\nmod metadata;\n\npub use self::types::{\n Metadata, Data,\n StreamInfo, Application, VorbisComment, CueSheet, Picture,\n SeekPoint, CueSheetTrack,...
rust
edit
1
0
bsd-3-clause
bcc8f5d2e4747513e3ab9ce824adcdd091ab4fc1
sourrust/flac
src/metadata/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// compile-flags: -Z unstable-options --scrape-examples-output-path t.calls --scrape-examples-target-crate foobar\n// check-pass\n#![no_std]\nuse core as _;\n\n```\n\nApply this change: Change output path to {{build-base}}" }, { "role...
rust
edit
0
0
apache-2.0
e13562c11897a2b1502f6e44abd1fd43fae66f7a
aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/rustdoc-ui/scrape-examples-ice.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub mod ui {\n extern crate term;\n use net;\n\n pub fn update(state: Result<net::State, net::State>) {\n match state {\n Ok(net::State::Online) => online(),\n Err(net::State::Offline) => offline(),\n ...
rust
edit
0
2
mit
2a2126dee828172b478a2f048915290df177e452
bascht/binichonline
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate maxminddb;\n\nuse std::net::IpAddr;\nuse std::str::FromStr;\n\nuse maxminddb::geoip2;\n\nfn main() {\n let reader = maxminddb::Reader::open_readfile(\"/usr/local/share/GeoIP/GeoIP2-City.mmdb\").unwrap();\n let ip: IpAddr = ...
rust
edit
0
1
isc
db57e1eed6a524ab7ff0577924dcaabf4ff19939
oschwald/maxminddb-rust
examples/lookup.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Cretonne code generation library.\n\n#![deny(missing_docs)]\n\npub use context::Context;\npub use legalizer::legalize_function;\npub use verifier::verify_function;\npub use write::write_function;\n\n/// Version number of the cretonne crat...
rust
edit
2
0
apache-2.0
493c39e7f9769094ef762f4b264f51c93b4faa5a
stoklund/cretonne,sunfishcode/cretonne,sunfishcode/cretonne,stoklund/cretonne,stoklund/cretonne,sunfishcode/cretonne
lib/cretonne/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse crate::{api_client::Client,\n common::ui::{Status,\n UIWriter,\n UI}};\n\nuse crate::{error::{Error,\n Result},\n PRODUCT,\n VERSION};\n\n...
rust
edit
0
8
apache-2.0
1f2fc2a1c5367603003c7530496de2f1dbc2f736
rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat
components/hab/src/command/origin/delete.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![no_std]\n\n#[doc(hidden)]\npub extern crate core as _core;\n\n/// Asserts at compile-time that the two types have equal sizes.\n#[macro_export]\nmacro_rules! assert_eq_size {\n ($x:ty, $y:ty) => {\n #[allow(unused_unsafe)]\n ...
rust
edit
0
0
apache-2.0
cdbfaa895b3c282fa7d50a4df14ea86fe12552a1
nvzqz/static-assertions-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(test)]\nextern crate racer_testutils;\nextern crate test;\nuse test::Bencher;\n\nuse racer_testutils::*;\n\n#[bench]\nfn completes_hashmap(b: &mut Bencher) {\n let src = r\"\n use std::collections::HashM~\n\";\n let mut va...
rust
edit
0
2
mit
09f186101ed13e98d68c9bdeea1faf914fc887bb
birkenfeld/racer,phildawes/racer,racer-rust/racer
benches/bench_stdlibs.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! An implementation of a buddy allocator.\n\nuse types::{UnsafeList, PhantomNode};\n\npub type FreeBlock = PhantomNode;\n\n#[allow(dead_code)]\npub struct Buddy<'a> {\n min_block_size: usize,\n max_order: u32,\n free_lists: &'a mut...
rust
edit
1
1
mit
35a4d12b8bcbace9d18713582b5554c46db74d70
uni-rs/uni.rs
src/libheap/src/buddy.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::ops::{Deref, DerefMut};\nuse joker::word::Name;\nuse joker::track::{TrackingRef, TrackingMut, Untrack, Span};\n\nuse expr::Expr;\nuse decl::Dtor;\nuse patt::Patt;\n\n#[derive(Debug, Eq, PartialEq, Clone, TrackingRef, TrackingMut)]\np...
rust
edit
2
2
mit
1bcddae487aa7a104ff8e53f75620ff6819836c7
RReverser/esprit,dherman/kora,dherman/kora,RReverser/esprit
crates/easter/src/id.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub struct Post {\n state: Option<Box<State>>,\n content: String\n}\n\nimpl Post {\n pub fn new() -> Post {\n Post {\n state: Some(Box::new(Draft {})),\n content: String::new()\n }\n }\n\n pu...
rust
edit
null
null
mit
16c146b6038ff8893f3d1d18cf53ebbeb538a265
pgrzesik/learning-rust
blog/src/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! An ASN.1 parser written in Rust.\n//!\n//! Taken from http://www.itu.int/rec/T-REC-X.680-200811-I\n\n#![allow(dead_code)] // Until parser is complete. Too noisy otherwise\n\n#[macro_use]\nextern crate nom;\n\nextern crate regex;\n\nmod pa...
rust
edit
1
0
mit
a02a3c4b1ae1c54fb82464149660bbbcd3c77edd
haxney/rust-asn1
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n\n\n/**\n * Bindings the runtime's random number generator (ISAAC).\n */\nnative \"rust\" mod rustrt {\n type rctx;\n fn rand_new() -> rctx;\n fn rand_next(c: rctx) -> u32;\n fn rand_free(c: rctx);\n}\n\ntype rng =\n obj {\n ...
rust
edit
null
null
apache-2.0
77dc2f313920abc72d0dfa2bfa0cb2929aa77b04
rust-lang/rand
src/lib/rand.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2...
rust
edit
0
0
apache-2.0
d895c18b22e8c0cbaf55b8db2525f1673c45a0a6
servo/sharegl
lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[cfg(test)]\nmod tests {\n #[test]\n fn it_works() {\n }\n}\n\npub fn test() {\n println!(\"Hello from lib.rs\");\n}\n\n#[derive(Debug)]\nenum Steps {\n Echo,\n Run,\n Shell,\n SetEnv,\n}\n\n\nfn parse_toml(filename: ...
rust
edit
0
3
mit
87e33594f07996a8e5a31dad1ad58a2468e90f77
nbigaouette/dna
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// BEGIN_CODE\nstruct MyClass {\n\tmy_field: isize\n}\n\nimpl MyClass {\n\t// constructor, by convention\n\tpub fn new(field: isize) -> MyClass {\n\t\tMyClass { my_field: field }\n\t}\n\n\t// destructor\n\tpub fn drop(&self) {\n\t}\n}\n// END...
rust
edit
0
1
apache-2.0
cc3ad1ce08987fd34681e9b5ebf199ba8178b5cd
wspeirs/rust-compare,wspeirs/rust-compare,wspeirs/rust-compare,wspeirs/rust-compare,wspeirs/rust-compare
code/rust/class_struct.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! This module serves as the entry point into Xtensis's main binary.\n\n// This file is part of Xtensis.\n\n// This is the Xtensis text editor; it edits text.\n// Copyright (C) 2016-2017 The Xtensis Developers\n\n// This program is free sof...
rust
edit
0
1
apache-2.0
4d49308dbe6c1216db9ea3f6301e3096d30927f4
shymega/slacs,shymega/slacs
src/bin/xtc.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Check for most signifigant bit in a byte" }, { "role": "assistant", "content": "//! An implementation of Google Protobuf's Variable-Length Integers\n\n/// The maximum number of bytes used by a 32-bit Varint\npub const VARINT_32_MAX...
rust
new_file
0
1
apache-2.0
6e09bfa080819103f6b19d2cdc9cbfdcc5f27ec9
Techern/Varint-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright:: Copyright (c) 2015-2016 The Habitat Maintainers\n//\n// The terms of the Evaluation Agreement (Habitat) between Chef Software Inc.\n// and the party accessing this file (\"Licensee\") apply to Licensee's use of\n// the Software...
rust
edit
7
1
apache-2.0
a2246c9318bb8eaf0d56a57b7993c7f3d8aa7433
rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat
src/fs.rs
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a c...
rust
edit
1
0
apache-2.0
bba553a410ef5b9b0e2d734e5296175e5e46dc8f
rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//\n// SOS: the Stupid Operating System\n// by Hawk Weisman (<EMAIL>)\n//\n// Copyright (c) 2015 Hawk Weisman\n// Released under the terms of the MIT license. See `LICENSE` in the root\n// directory of this repository for more informatio...
rust
edit
6
1
apache-2.0
2efa7ac86ecff4ba850c03dcf85d14aa0d01f253
hawkw/sos-kernel,rachlmac/sos-kernel,hawkw/sos-kernel,rachlmac/sos-kernel,rachlmac/sos-kernel,hawkw/sos-kernel
src/lib.rs
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! **arrayvec** provides the types `ArrayVec` and `ArrayString`: \n//! array-backed vector and string types, which store their contents inline.\n//!\n//! The arrayvec package has the following cargo features:\n//!\n//! - `std`\n//! - Optio...
rust
edit
1
0
apache-2.0
d273861cde87ac91a18e2a169512443b848e7585
bluss/arrayvec
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use(crate_version, crate_authors)]\nextern crate clap;\n\nuse clap::{App, Arg};\n\nfn main() {\n\n let matches = App::new(\"aux2bib\")\n .version(crate_version!())\n .author(crate_autho...
rust
edit
0
2
apache-2.0
55ec26d4c6a07fdc845b4cd7cd8100a4f65f0d6e
musoke/inspirer,musoke/inspirer
src/bin/aux2bib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse parse::IrcMsg;\n\n\npub trait FromIrcMsg {\n fn from_irc_msg(msg: IrcMsg) -> Result<Self, IrcMsg>;\n}\n```\n\nApply this change: Add Sized bound to FromIrcMsg to fix warning" }, { "role": "assistant", "content": "use parse:...
rust
edit
0
0
apache-2.0
c6f0023d620e69081999ae3061c935473c2d4e5d
infinityb/rust-irc
src/message_types/traits.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Add basic types and a `load` function" }, { "role": "assistant", "content": "#![feature(no_std)]\n#![no_std]\n\npub unsafe fn load(address: usize) -> &'static Multiboot {\n let multiboot = &*(address as *const Multiboot);\n a...
rust
new_file
1
2
apache-2.0
3a188b634c0c59db4594eb59f908edc6f5f7765e
phil-opp/multiboot2-elf64
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate identicon;\nextern crate openssl;\nextern crate png;\n\nuse std::io;\nuse std::os;\n\nuse openssl::crypto::hash::{Hasher, HashType};\nuse png::write_png;\n\nuse identicon::Identicon;\n\nfn main() {\n match hash() {\n So...
rust
edit
0
3
mit
a558dda5aae2c9ea8675fdb756dd1bb06b3d7ac1
dgraham/identicon
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2014 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n//...
rust
edit
0
1
apache-2.0
1e22b2088466eb0e19a58aefcbdaa29858af68e4
zaeleus/rust,aepsil0n/rust,mahkoh/rust,AerialX/rust-rt-minimal,TheNeikos/rust,ebfull/rust,XMPPwocky/rust,jroesch/rust,dinfuehr/rust,sae-bom/rust,reem/rust,ejjeong/rust,untitaker/rust,pelmers/rust,ebfull/rust,dwillmer/rust,victorvde/rust,reem/rust,kimroen/rust,XMPPwocky/rust,aidancully/rust,bombless/rust,emk/rust,KokaKi...
src/test/run-pass-fulldeps/roman-numerals-macro.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse parser::Parser;\n\nmod token;\nmod parser;\nmod error;\n\nfn main() {\n let mut parser = Parser::new(\"C3HeH4\");\n println!(\"{:?}\", parser.parse_molecule());\n}\n```\n\nApply this change: Allow unstable note in the crate" }, ...
rust
edit
2
1
mit
1df4b8bc30d5dd9e55c5fd1091ea391f284370db
opp11/chemtool2
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt::{Display, Formatter, Result as FmtResult};\n\n\n/// Encode a string as xtext\npub struct XText<'a>(pub &'a str);\n\nimpl<'a> Display for XText<'a> {\n fn fmt(&self, f: &mut Formatter) -> FmtResult {\n let mut rest = se...
rust
edit
0
7
mit
457608170301692afef2d5981c9c5f0574f157ba
stephank/tokio-smtp
src/util.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate error_chain;\nextern crate reqwest;\nextern crate serde;\n#[macro_use]\nextern crate serde_derive;\nextern crate serde_json as json;\nextern crate toml;\nextern crate url;\n\nmod config;\nmod crates_io;\nmod errors;...
rust
edit
3
0
mit
e488c1932930543ebc93a243bd87b18ecf9433a0
woxtu/cargo-thank-you-stars
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate mio;\n\nuse std::io;\nuse std::result;\nuse std::net::{SocketAddr, ToSocketAddrs};\nuse mio::{EventLoop, Handler, Token};\nuse mio::tcp::{TcpListener, TcpStream};\n\n#[derive(Debug)]\npub struct HttpError;\n\npub type Result<T> =...
rust
edit
0
1
mit
879bd24d4e892da317cff1fdcece9af0765b87a9
krsnik02/rust-http,krsnik02/rust-http2
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! **rosc** is an implementation of the [OSC 1.0](http://opensoundcontrol.org/spec-1_0) protocol in pure Rust.\n//!\n\nextern crate byteorder;\nextern crate regex;\nextern crate nom;\n\n/// Crate specific error types.\nmod errors;\n/// OSC d...
rust
edit
3
0
apache-2.0
737d6e1ee57e3a4955319e422f06071abd9f9e18
klingtnet/rosc
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nenum Mnemonic {\n Add, Call, Cls, Drw,\n Jp, Ld, Or, Ret,\n Rnd, Se, Shl, Shr,\n Sknp, Skp, Sne, Sub,\n Subn, Sys, Xor,\n}\n\nenum Register {\n V0, V1, V2, V3,\n V4, V5, V6, V7,\n V8, V9, Va, Vb,\n Vc, Vd, Ve, Vf,\n...
rust
edit
7
1
mit
b41585fb8b5a1abbfb227d31e3ffcaca569f5427
francis36012/c8asm
src/main.rs
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse syntax;\nuse syntax::codemap::DUMMY_SP;\nuse syntax::ext::base::ExtCtxt;\n\n/// Create a fake ExtCtxt to perform macro quasiquotes outside of rustc plugins\npub fn with_fake_extctxt<T, F: Fn(&ExtCtxt) -> T>(f: F) -> T {\n let ps = syntax...
rust
edit
1
1
mit
6f978cabd6f20dad1f2915b0d95412b61fd7a423
tempbottle/rust-peg,loganmhb/rust-peg,a-wortman/rust-peg,a-wortman/rust-peg,kevinmehall/rust-peg,tempbottle/rust-peg,daramos/rust-peg,jsgf/rust-peg,loganmhb/rust-peg,kevinmehall/rust-peg,jsgf/rust-peg,daramos/rust-peg
src/fake_extctxt.rs
rejected_duplicate
Near-duplicate of sample 120056
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! A parser for OpenType fonts.\n//!\n//! ## Example\n//!\n//! ```\n//! extern crate opentype;\n//! extern crate truetype;\n//!\n//! use opentype::File;\n//! use truetype::NamingTable;\n//!\n//! # fn main() {\n//! let path = \"SourceSerifPro...
rust
edit
2
0
mit
1e7b6c301e7650294e2eb9befa9abec85dd598b4
stainless-steel/opentype
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Muxed. A tmux project manager with no runtime dependencies.\nextern crate getopts;\nextern crate libc;\n\nuse std::os;\nuse std::io::{println};\n\nmod help;\nmod arg_parse;\nmod creator {\n mod io { }\n}\n\n/// The main execution method....
rust
edit
1
5
mit
347ac44480c2a784a059abab589b6ef386c952b8
brianp/muxed,brianp/muxed
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_id = \"rust_js\"]\n#![crate_type = \"lib\"]\n#![comment = \"Rust Javascript parsing and interpretation library\"]\n#![license = \"MIT\"]\n#![deny(deprecated_owned_vector)]\n#![deny(non_uppercase_statics)]\n#![deny(missing_doc)]\n#![d...
rust
edit
10
0
mit
6e9a9e5b418e3023a59c3256525856c2c842a180
synlestidae/js.rs,synlestidae/js.rs,TomBebbington/js.rs,new-mind/js.rs,TomBebbington/js.rs,new-mind/js.rs
src/lib.rs
rejected_lint
Too many lint violations: 10
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Frunk: generic functional programming toolbelt for Rust\n//!\n//! Aims to be a collection of functional programming abstractions implemented in Rust\n//! in effective, useful, and idiomatic ways.\n//!\n//! Here is a small taste of what Fr...
rust
edit
1
0
mit
86c25a1e129f5e2191b98b51bb51487ef0134930
lloydmeta/frunk
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![no_std]\n\n#[doc(hidden)]\npub extern crate core as _core;\n\n/// Asserts at compile-time that the two types have equal sizes.\n///\n/// # Example\n///\n/// ```\n/// #[macro_use]\n/// extern crate static_assertions;\n///\n/// struct Byte(u...
rust
edit
0
0
apache-2.0
a8cea7df22e093bb86e2f03bae8d37767095d932
nvzqz/static-assertions-rs
src/lib.rs
rejected_duplicate
Near-duplicate of sample 121205
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(libc)]\n#![feature(core)]\n#![feature(debug_builders)]\nextern crate libc;\n\npub mod instruction;\npub mod constants;\npub mod ffi;\npub mod capstone;\n\npub use instruction::*;\npub use constants::*;\n\npub use capstone::Capstone...
rust
edit
5
3
mit
a93001f87a85441009cbd5429300da8789b18f08
richo/capstone-rs
src/lib.rs
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/*!\n\n[Sidekiq](https://github.com/mperham/sidekiq) client allowing to push jobs.\nUsing the [Sidekiq job\nformat](https://github.com/mperham/sidekiq/wiki/Job-Format) as reference.\n\n# Default environment variables\n\n* REDIS_URL=\"redis://...
rust
edit
0
0
mit
5260466cacd8d6669a962c0a49957ca291c3da0e
spk/rust-sidekiq
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! The module contains implementations of the transport layer functionality\n//! that HTTP/2 requires. It exposes APIs that allow the HTTP/2 connection to\n//! use the transport layer without requiring it to know which exact\n//! implementat...
rust
edit
0
0
mit
8223f86dc9f48e9203ea194feac64144e073c78f
mlalic/solicit,Galvanization/solicit,stepancheg/solicit,gwicke/solicit,jinnjuice/solicit,tempbottle/solicit
src/http/transport.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate ratelimit_meter;\n\nuse ratelimit_meter::{GCRA, Threadsafe, Limiter, Decider, Decision};\nuse std::thread;\n\n#[test]\nfn simple_operation() {\n let mut lim = Limiter::new()\n .capacity(5)\n .weight(1)\n ....
rust
edit
0
4
mit
b0f186923e838c20cc9f4fd082e4db1ca8e96a15
antifuchs/ratelimit_meter
tests/threadsafe.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_name = \"zipWith\"]\n#![crate_type = \"lib\"]\n\nuse std::iter::{ Iterator, IntoIterator };\n\n#[derive(Clone)]\n#[must_use = \"iterator adaptors are lazy and do nothing unless consumed\"]\npub struct ZipWith<A, B, C> {\n left: A,...
rust
edit
5
2
mit
a31dafb1ef59e0b6db8177ea321ece7d708f812d
kjgorman/zipWith.rs
src/lib.rs
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Command line utility for querying and working with Iridium SBD messages.\n\nextern crate docopt;\nextern crate rustc_serialize;\n\nuse docopt::Docopt;\n\nconst USAGE: &'static str = \"\nIridium Short Burst Data (SBD) message utility.\n\nU...
rust
edit
0
2
apache-2.0
1c2d8d7aea95a1dc76ca5acf196cbf03b5b660a3
gadomski/sbd-rs
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse consumer::*;\n\n/// Represents a subscription to a `Stream`\npub struct Subscription {\n closed: bool,\n}\n\nimpl Subscription {\n /// Closes the `Subscription`\n pub fn close(mut self) {\n self.closed = true;\n }\n\n ...
rust
edit
1
1
mit
048ab12ec24b913b01574196798236880b9b0ffe
danylaporte/rust-asyncplify
src/subscription.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse common::util::*;\n\n#[test]\nfn test_uname_compatible() {\n let (_, mut ucmd) = at_and_ucmd!();\n\n let result = ucmd.arg(\"-a\").run();\n assert!(result.success);\n}\n\n#[test]\nfn test_uname_name() {\n let (_, mut ucmd) = at...
rust
edit
0
1
mit
a93d007cde36a3370d25e7a7bf9646f266875601
uutils/coreutils,uutils/coreutils,uutils/coreutils
tests/test_uname.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// edition:2018\n\n#![no_core]\n#![feature(no_core)]\n\n// @count issue_89852/index.html '//*[@class=\"macro\"]' 2\n// @has - '//*[@class=\"macro\"]/@href' 'macro.repro.html'\n#[macro_export]\nmacro_rules! repro {\n () => {};\n}\n\n// @!ha...
rust
edit
0
0
apache-2.0
db5b64a484dbea09f1f39e0640662b50c6e934cd
aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust
src/test/rustdoc/issue-89852.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Abstractions for page tables and other paging related structures.\n//!\n//! Page tables translate virtual memory “pages” to physical memory “frames”.\n\npub use self::frame::PhysFrame;\npub use self::frame_alloc::{FrameAllocator, FrameDea...
rust
edit
1
0
mit
79296f7e616f46829cff2de8970d3d5a628046b2
phil-opp/rust-x86_64
src/structures/paging/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(test)]\n\nextern crate test;\nextern crate scribe;\n\nuse test::Bencher;\nuse scribe::Workspace;\nuse std::path::PathBuf;\n\n#[bench]\nfn bench_tokens(b: &mut Bencher) {\n // Create a workspace with this benchmark test as a buff...
rust
edit
0
3
mit
d1066f7cc588eef67f0d32e3524294a676e9c0e5
jmacdonald/scribe
benches/buffer_tokens.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2020 Google LLC\n//\n// Use of this source code is governed by an MIT-style license that can be found\n// in the LICENSE file or at https://opensource.org/licenses/MIT.\n\n```\n\nApply this change: Create RRG-specific wrappers fo...
rust
edit
0
0
mit
33c1cc7b1f54bab410a538a2ef2682ec2d02f3de
google/rrg
macro/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::error::Error;\nuse std::fs;\nuse std::path::Path;\n\nuse package::find;\nuse operation::selection;\nuse paths::{ self, PathAppend };\n\npub fn uninstall(input: &str, base_path: &Path) -> Result<bool, String> {\n let package_list_d...
rust
edit
1
3
bsd-3-clause
1c463de97e748228ed0bd018e7db05c45e2195c6
hch12907/wiz
src/operation/uninstallation.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate josephpd3;\n\nuse josephpd3::*;\n\n#[test]\nfn lonely_hearts_club() {\n let v = vec!['1', '1', '2', 'a', 'b', 'b', 'b', 'c', 'c'];\n assert_eq!(get_lonely_items(&v), vec!['2', 'a']);\n}\n```\n\nApply this change: Add test f...
rust
edit
0
1
mit
31fb55ab77417796b654407af456250c36b5f654
DakRomo/2017Challenges,DakRomo/2017Challenges,mindm/2017Challenges,DakRomo/2017Challenges,popcornanachronism/2017Challenges,mindm/2017Challenges,m181190/2017Challenges,mindm/2017Challenges,erocs/2017Challenges,mindm/2017Challenges,DakRomo/2017Challenges,popcornanachronism/2017Challenges,mindm/2017Challenges,mindm/2017C...
challenge_2/rust/josephpd3/tests/single_count.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(rustc_private, plugin_registrar)]\n\nextern crate syntax;\nextern crate rustc;\n\nmod derive_action;\n\nuse rustc::plugin::Registry;\nuse syntax::parse::token::intern;\nuse syntax::ext::base::SyntaxExtension;\n\nuse derive_action::...
rust
edit
0
1
mit
e341ab5d94ebe2834f272cc634be55ec7eb234c5
burtonageo/rebind
rebind_plugins/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Generic Tree Implementation for Plan\n\npub enum TreeNode<T> {\n Branch(T, Vec<Box<TreeNode<T>>>),\n Leaf(T)\n}\n\n/// Tree Builder in a bottom up approach.\npub struct TreeBuilder<T> \n{\n stack: Vec<TreeNode<T>>\n}\n\nimpl<T> TreeBui...
rust
edit
0
2
apache-2.0
33a335e86b7dcd5ccd0291c4adcf84d90dac767d
hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak
util/tree.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Available RPC methods types and ids.\nuse ssz_derive::{Decode, Encode};\nuse types::{Epoch, Hash256, Slot};\n\n#[derive(Debug)]\npub enum RPCMethod {\n Hello,\n Unknown,\n}\n\nimpl From<u16> for RPCMethod {\n fn from(method_id: u...
rust
edit
0
2
apache-2.0
0e8b17477070678dd1f770039faab1232cca87d6
sigp/lighthouse,sigp/lighthouse,sigp/lighthouse,sigp/lighthouse
beacon_node/libp2p/src/rpc/methods.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nfn main() {\n let home = std::env::home_dir().unwrap();\n let mut sbt_jar = std::path::PathBuf::from(home);\n sbt_jar.push(\".sbt/launchers/0.13.13/sbt-launch.jar\");\n let sbt_jar = sbt_jar;\n use std::os::unix::process::Comma...
rust
edit
2
2
apache-2.0
401511e6a3457be06c9052c9b012b910d7eb31fd
dwijnand/sbtl,dwijnand/sbtl
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub fn max_array(x: &mut[int, ..65536], y: &[int, ..65536]) {\n for i in range(0u, 65536) {\n if y[i] > x[i] {\n x[i] = y[i];\n }\n }\n}\n\n```\n\nApply this change: Fix up rust example for 1.0" }, { "role": "assistant", ...
rust
edit
1
3
bsd-2-clause
1a124be93283524e09f7ef49196af6ee9bd451f8
sigma-random/gcc-explorer,dkm/gcc-explorer,ibuclaw/gcc-explorer,dkm/gcc-explorer,sigma-random/gcc-explorer,olajep/gcc-explorer,mcanthony/gcc-explorer,mattgodbolt/compiler-explorer,ibuclaw/gcc-explorer,dkm/gcc-explorer,sigma-random/gcc-explorer,olajep/gcc-explorer,sigma-random/gcc-explorer,zengyuleo/gcc-explorer,mattgod...
examples/rust/max_array.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse camera::Camera;\nuse vector::Vector;\nuse std::fs::File;\nuse std::io::prelude::*;\nmod sphere;\nmod ray;\nmod colour;\nmod vector;\nmod camera;\n\nfn main() {\n\tlet width = 640;\n\tlet height = 480;\n\tlet campos = Vector::new(1.0,1.0,...
rust
edit
1
4
mit
710806cd0a20b16f66faaf35e485138c4a0091e5
faineance/rust-tracer
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate gcc;\n\nuse std::env;\n\npub fn main() {\n let target = env::var(\"TARGET\").unwrap();\n\n let os = if target.contains(\"linux\") {\n \"LINUX\"\n } else if target.contains(\"darwin\") {\n \"DARWIN\"\n } ...
rust
edit
0
3
mit
18eeb27e09fa9015a6484f34afa226eca1d25392
nix-rust/nix,geofft/nix-rust,nix-rust/nix,MarkusJais/nix-rust,xd009642/nix,carllerche/nix-rust,geofft/nix-rust,Susurrus/nix,Susurrus/nix,asomers/nix,Susurrus/nix,xd009642/nix,carllerche/nix-rust,MarkusJais/nix-rust,carllerche/nix-rust,asomers/nix,xd009642/nix,geofft/nix-rust,MarkusJais/nix-rust
nix-test/build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse nom::{IResult, alpha, alphanumeric};\nuse std::vec::Vec;\n\nuse template::Chunk;\n\nfn rest(i: &[u8]) -> IResult<&[u8], &[u8]> {\n IResult::Done(&[], i)\n}\n\nnamed!(var_name<&[u8], Vec<u8>>,\n map!(\n recognize!(\n ...
rust
edit
1
0
mit
c879d70414782c33c5403f65f005c4dbd433cafe
artemshitov/stamp
src/parser.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Data types used to describe the data that makes up the Chip8.\n\n/// One byte in RAM.\npub type MemoryCell = u8;\n/// A value in an 8-bit register.\npub type Register8 = u8;\n/// A value in a 16-bit register.\npub type Register16 = u16;\n...
rust
edit
0
0
mit
7ad8153fb3c2824d5d697200948a479fec9163f7
jdeeny/rust-chip8
src/types.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! An implementation of [FLAC](https://xiph.org/flac), free lossless audio\n//! codec, written in Rust.\n\n#[macro_use]\nextern crate nom;\n\n#[macro_use]\nmod utility;\npub mod metadata;\npub mod frame;\npub mod subframe;\npub mod stream;\n...
rust
edit
1
0
bsd-3-clause
c5bd0dfdb585d5506a8b81da11809d51ce934d5b
sourrust/flac
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Some microbenchmarks that stress test a pure `join` path.\n\nuse rayon;\nuse rayon::prelude::*;\nuse test::Bencher;\n\n#[bench]\nfn increment_all(b: &mut Bencher) {\n let mut big_vec = vec![0_usize; 100*1024];\n b.iter(|| {\n ...
rust
edit
1
4
apache-2.0
5d6d120b8d9ea28bfb00d31d9f4f32facfb26c66
cuviper/rayon,cuviper/rayon
rayon-demo/src/join_microbench.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_name = \"helloworld-server\"]\n#![feature(old_io, std_misc)]\n\n/// Hello World server in Rust\n/// Binds REP socket to tcp://*:5555\n/// Expects \"Hello\" from client, replies with \"World\"\n\nextern crate zmq;\n\nuse std::old_io;\...
rust
edit
0
1
apache-2.0
783c25a1fe17270f86e86595ba90d850d2007ab5
jedisct1/rust-zmq,dginev/rust-zmq,alexkamp/rust-zmq,erickt/rust-zmq,pfernie/rust-zmq,tempbottle/rust-zmq,pblasucci/rust-zmq,petehayes102/rust-zmq
examples/zguide/helloworld-server/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\npub fn puzzle(input: &str) -> u32 {\n 0\n}\n\npub fn is_a_triangle(a: u32, b: u32, c: u32) -> bool {\n a + b > c && b + c > a && c + a > b\n}\n\n#[cfg(test)]\nmod test {\n use super::*;\n\n #[test]\n fn equilateral_triangle()...
rust
edit
1
3
mit
1574b3224cf6f48dedc1c991d3f81882b3c0e52e
carols10cents/adventofcode-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate hamming as dna;\n\n#[test]\nfn test_no_difference_between_empty_strands() {\n assert_eq!(dna::hamming_distance(\"\", \"\").unwrap(), 0);\n}\n\n#[test]\n#[ignore]\nfn test_no_difference_between_identical_strands() {\n assert...
rust
edit
0
1
mit
0baa1206f82bbfebeb74169802071aab85bda3f7
sacherjj/rust,exercism/xrust,sacherjj/rust,petertseng/exercism-rust,petertseng/exercism-rust,petertseng/exercism-rust,exercism/xrust,sacherjj/rust
exercises/hamming/tests/hamming.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::{stdin, File, timer};\nuse std::io::buffered::BufferedReader;\nuse std::str::{from_utf8};\n\nfn main () {\n let p = Path::new(\"data/example.txt\");\n let contents = File::open(&p).read_to_end();\n let mut string_iter = from_u...
rust
edit
0
2
mit
b7fe3e4be2fc281689a7c38d60c163c84e78d7fd
lord/rustoleum
rustoleum.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! This crate currently provides pull parser for Binary FBX.\n//!\n//! FBX data consists of generic node and node properties, and it requires interpretation to use as\n//! 3D contents.\n//! It is similar to relation of XML and COLLADA. COLLA...
rust
edit
1
0
apache-2.0
da8e99da02f03f586c70e7565ab2a6577c4ec55b
l1048576/fbx_direct
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Add interface to query available converter names" }, { "role": "assistant", "content": "// Copyright 2021 Luis Cáceres\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except i...
rust
new_file
0
2
apache-2.0
b8c6a5521671ea903305efbb484ed2600a8fa01d
google/rust_icu,google/rust_icu
rust_icu_ucnv/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// $ cargo bench --features full --bench file\n\n#![feature(rustc_private, test)]\n#![recursion_limit = \"1024\"]\n#![allow(clippy::missing_panics_doc, clippy::must_use_candidate)]\n\nextern crate test;\n\n#[macro_use]\n#[path = \"../tests/ma...
rust
edit
0
2
apache-2.0
6ee9cfd152c0de76fdb868b30a1e1d6ec3d9547c
dtolnay/syn
benches/file.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: libuni: Add definition of some thread related types" }, { "role": "assistant", "content": "//! Scheduling primitives for Uni.rs.\n\nuse alloc::boxed::Box;\n\nuse intrusive::link::Link;\nuse intrusive::list::{Node, Owner};\n\nconst ...
rust
new_file
0
2
mit
ef77e70f289e7df6ecd8c757a80252533ae0d678
uni-rs/uni.rs
src/libuni/src/thread/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// only-linux\n\n#![feature(rustc_private)]\nextern crate libc;\n\nfn main() {\n let mut buf = [0u8; 5];\n unsafe {\n libc::syscall(libc::SYS_getrandom, buf.as_mut_ptr() as *mut libc::c_void, 5 as libc::size_t, 0 as libc::c_uint)...
rust
edit
0
1
apache-2.0
92436805885c28cfee7cb52d2b2fe742e4c3cb4f
rust-lang/miri,rust-lang/miri,rust-lang/miri,rust-lang/miri,tsion/miri
tests/compile-fail/getrandom.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\nuse std::ops::{Deref, DerefMut};\n\nuse analysis::Analyzer;\nuse analysis::tokenizers::TokenizerSpec;\nuse analysis::filters::FilterSpec;\n\n\n#[derive(Debug)]\npub struct AnalyzerRegistry {\n analyzers: Has...
rust
edit
0
1
apache-2.0
575ac7ee041f4cc9424976646f121bb61a08476b
kitesearch/kite
abra/src/analysis/registry.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Types used in this bot implementation.\n\nuse errors::CommandParseError;\n\n\n#[derive(Debug, Clone)]\npub struct Command {\n pub name: String,\n pub params: Vec<String>,\n}\n\n\n/// Parse a text message, return a command if possibl...
rust
edit
1
3
mit
7389537d7040519d1507ac97da0bf6d1086a1b44
coredump-ch/telegram-groups-bot,coredump-ch/telegram-groups-bot
src/types.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Implements http://rosettacode.org/wiki/Averages/Arithmetic_mean\n\n// The mean is not defined for an empty list, so we must return an Option\nfn mean(list: &[f64]) -> Option<f64> {\n match list.len() {\n 0 => None,\n n => ...
rust
edit
0
2
unlicense
ebbd11f594b5214fa37b1e551fff95d9b87c41a2
crespyl/rust-rosetta,sakeven/rust-rosetta,crr0004/rust-rosetta,pfalabella/rust-rosetta,magum/rust-rosetta,magum/rust-rosetta,JIghtuse/rust-rosetta,Hoverbear/rust-rosetta,ghotiphud/rust-rosetta,ZoomRmc/rust-rosetta
src/arithmetic_mean.rs
accepted
null
true