conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "chore(cli): Add option for other subcommands and ENV fallbacks\n"
},
{
"from": "human",
"value": "use structopt::StructOpt;\n\n/// The CaSILE command line interface, publishing automation level wizard.\n#[derive(StructOpt)]\nstruct Cli {\n // #[structopt(short, l... | rust | chosen |
[
{
"from": "system",
"value": "Fix hostname, some IRC servers doesn't accept @ in hostnames\n"
},
{
"from": "human",
"value": "extern crate tiny;\n\nuse tiny::Tiny;\n\nfn main() {\n Tiny::run(\"tiny_test\".to_owned(), \"tiny@tiny\".to_owned(), \"yada yada\".to_owned());\n}\n"
},
{
"fro... | rust | chosen |
[
{
"from": "system",
"value": "Fix Handling of Segment History Element Missing\n"
},
{
"from": "human",
"value": "use {Segment, Attempt, TimingMethod, TimeSpan};\nuse super::ComparisonGenerator;\n\n#[derive(Copy, Clone, Debug)]\npub struct LastFinishedRun;\n\npub const NAME: &'static str = \"Last... | rust | chosen |
[
{
"from": "system",
"value": "Remove debug statements in MapFromString\n"
},
{
"from": "human",
"value": "use engine::{Map, Tile};\nuse engine::builders::{MapBuilder, MapBuildError, MapBuildResult};\n\nuse std::iter::{IteratorExt};\n\npub struct MapFromString {\n s: String,\n}\n\nimpl MapFrom... | rust | chosen |
[
{
"from": "system",
"value": "Make discriminant test values huge to make mistakes more apparent\n"
},
{
"from": "human",
"value": "#![no_std]\n\n#[macro_use]\nextern crate enum_map;\n\nuse enum_map::EnumMap;\n\n#[derive(Debug, EnumMap, PartialEq)]\nenum Discriminants {\n A = 2,\n B = 0,\n ... | rust | chosen |
[
{
"from": "system",
"value": "Tweak number of clusters per line\n"
},
{
"from": "human",
"value": "use std::error;\n\nuse fat;\n\npub fn detail_file(args: &[String])\n -> Result<(), Box<error::Error>>\n{\n if args.len() < 2 {\n return Err(From::from(\"expected <file> <image> filenam... | rust | chosen |
[
{
"from": "system",
"value": "Revert \"Locking turtles in export even though they aren't used (guarantees that mutation is impossible)\"\n\nThis reverts commit 61682a533a2de6e92d0e85bb75b95d14bdc0721b.\n"
},
{
"from": "human",
"value": "use std::path::Path;\n\nuse tokio::sync::Mutex;\n\nuse crat... | rust | chosen |
[
{
"from": "system",
"value": "Add converter from for Date\n"
},
{
"from": "human",
"value": "use std::error::Error;\n\nuse serde::Serialize;\nuse serde::Serializer;\nuse serde::Deserialize;\nuse serde::Deserializer;\nuse serde::de::Visitor;\nuse serde::de::Error as SerdeError;\nuse chrono::naive... | rust | chosen |
[
{
"from": "system",
"value": "Remove `icompr!` macro from day 7.\n"
},
{
"from": "human",
"value": "#[macro_use]\nextern crate itertools;\n\nuse itertools::Itertools;\n\nfn main() {\n println!(\"24 days of Rust - itertools (day 7)\");\n let mut words = \"hello supercalifragilisticexpialido... | rust | chosen |
[
{
"from": "system",
"value": "Print fortune using fortune command\n"
},
{
"from": "human",
"value": "fn main() {\n println!(\"Hello, world!\");\n}\n"
},
{
"from": "gpt",
"value": "use std::io::Write;\nuse std::process::Command;\n\nconst FORTUNE: &str = \"fortune\";\n\nfn main() {\... | rust | chosen |
[
{
"from": "system",
"value": "Move write_to to trait implementation\n"
},
{
"from": "human",
"value": "use std::io;\nuse byteorder::WriteBytesExt;\nuse super::{MessageType, WriteTo};\nuse super::messages::{AddEntry, EntryExpired, Entry, RemoveEntry};\n\npub enum Message {\n Ping,\n AddEntr... | rust | chosen |
[
{
"from": "system",
"value": "Include the \"machine\" module so the tests run.\n"
},
{
"from": "human",
"value": "use std::io::{self, Write};\n\nfn main() {\n println!(\"Welcome to Chifir!\");\n println!(\"\");\n println!(\"Type 'help' to get started.\");\n\n loop {\n print!(\... | rust | chosen |
[
{
"from": "system",
"value": "fix: Handle missing overrides file gracefully\n"
},
{
"from": "human",
"value": "use std::env;\nuse std::io::prelude::*;\nuse std::io::BufReader;\nuse std::collections::HashMap;\nuse std::path::PathBuf;\nuse std::fs::File;\n\nstatic OVERRIDES_PATH : &'static str = \... | rust | chosen |
[
{
"from": "system",
"value": "Remove unnecessary 'static in consts\n"
},
{
"from": "human",
"value": "// Copyright 2017 Serde Developers\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 o... | rust | chosen |
[
{
"from": "system",
"value": "Store GapBuffer data as a byte vector.\n"
},
{
"from": "human",
"value": "use super::Position;\nuse super::Range;\n\npub struct GapBuffer {\n data: String,\n}\n\npub fn new(mut data: String) -> GapBuffer {\n // Ensure that the data has enough room to grow with... | rust | chosen |
[
{
"from": "system",
"value": "Add tests for must_use statements\n"
},
{
"from": "human",
"value": "#![deny(unused_must_use)]\n\n#[macro_use]\nextern crate diesel;\n\nuse diesel::*;\n\ntable! {\n stuff (b) {\n b -> Bool,\n }\n}\n\n\nfn main() {\n use stuff::table as st;\n use s... | rust | chosen |
[
{
"from": "system",
"value": "Test now ignored because of deadlock\n"
},
{
"from": "human",
"value": "extern crate httpd = \"tiny-http\";\n\nuse std::io::net::tcp::TcpStream;\n\n#[test]\nfn basic_handling() {\n let (server, port) = httpd::Server::new_with_random_port().unwrap();\n\n let mu... | rust | chosen |
[
{
"from": "system",
"value": "Include newline in example log output\n\nThe example output was previously unreadable, since the log format\ndidn't include a newline. Perhaps related to the env_logger bump.\n"
},
{
"from": "human",
"value": "extern crate chrono;\nextern crate env_logger;\nextern c... | rust | chosen |
[
{
"from": "system",
"value": "Revert \"Remove is_whitespace function as no longer used\" since actually STILL used\n\nThis reverts commit 21d02a285521f2dcf3ce2983898fb663c62366c5.\n"
},
{
"from": "human",
"value": "// This Source Code Form is subject to the terms of the Mozilla Public\n// Licens... | rust | chosen |
[
{
"from": "system",
"value": "Change how One trait is implemented\n"
},
{
"from": "human",
"value": "use std::ops::Add;\n\npub mod point;\npub mod rect;\n\npub type Point<T> = point::Point<T>;\npub type Rect<T> = rect::Rect<T>;\n\ntrait One<T>\n where T: Add<i32, Output=T> +\n Def... | rust | chosen |
[
{
"from": "system",
"value": "Add code from Gist. Slight modifications to naming, visibility, and use of $crate\n"
},
{
"from": "human",
"value": "#[test]\nfn it_works() {\n}\n"
},
{
"from": "gpt",
"value": "pub struct HNil;\n \npub struct HCons<H, T> {\n pub head: H,\n pub tai... | rust | chosen |
[
{
"from": "system",
"value": "Select last translation inserted for each key/locale pair\n\nNaive approach with ids for now.\n"
},
{
"from": "human",
"value": "extern crate iron;\nextern crate rustc_serialize;\n\nuse iron::headers::ContentType;\nuse iron::prelude::*;\nuse iron::status;\nuse diese... | rust | chosen |
[
{
"from": "system",
"value": "Implement Default::default & new for PerCoreVariable\n"
},
{
"from": "human",
"value": "use vmx;\nuse collections::vec::Vec;\nuse core::sync::atomic::{ATOMIC_U16_INIT, AtomicU16, Ordering};\nuse spin;\n\n\nstatic CPU_COUNT: spin::Once<u16> = spin::Once::new();\nstat... | rust | chosen |
[
{
"from": "system",
"value": "Add test for empty password\n\nHandling empty passwords properly.\n\nI don't have an explicit check for empty passwords in the keyring\nlibrary (front-end or any of the backends). Instead, I rely on the\nsystem vaults (or as close as possible to that interface) to report back\n... | rust | chosen |
[
{
"from": "system",
"value": "Make PHI nodes more type safe.\n"
},
{
"from": "human",
"value": "use value::Value;\nuse block::BasicBlock;\nuse ffi::core;\n\n/// A PHI node represents a value which is selected based on the predecessor of the current block.\npub type PhiNode = Value;\n\nimpl PhiNo... | rust | chosen |
[
{
"from": "system",
"value": "Add fn join_group to RadioToolButton\n"
},
{
"from": "human",
"value": "use std::ptr;\n\nuse RadioToolButton;\nuse ToolItem;\nuse ffi;\nuse glib::object::Downcast;\nuse glib::translate::*;\n\nimpl RadioToolButton {\n pub fn new() -> RadioToolButton {\n ass... | rust | chosen |
[
{
"from": "system",
"value": "net/eth: Add definition of type EtherTypeExtractor\n"
},
{
"from": "human",
"value": "//! Implementation of Ethernet related Extractors\n"
},
{
"from": "gpt",
"value": "//! Implementation of Ethernet related Extractors\n\nuse net::Packet;\n\nuse net::def... | rust | chosen |
[
{
"from": "system",
"value": "Update code sample for chapter 9.\n"
},
{
"from": "human",
"value": "fn main() {\n let a_vector = ~[1,2,3];\n let mut mut_vector = a_vector;\n mut_vector[0] = 5;\n\n println!(\"The first number is {:d}.\", mut_vector[0])\n}\n\n"
},
{
"from": "gpt... | rust | chosen |
[
{
"from": "system",
"value": "Build sys crate with opt-level 2\n\nIt looks like by default optimization level for C code was the same as\nfor Rust, which caused LMDB to be built with -O3 in release mode and\nthat is not supported officially => sometimes it crashed.\n\nFixes #40\n"
},
{
"from": "huma... | rust | chosen |
[
{
"from": "system",
"value": "Update link libraries to ensure that check-servo-net can link skia\n"
},
{
"from": "human",
"value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obt... | rust | chosen |
[
{
"from": "system",
"value": "Adjust test to new API"
},
{
"from": "human",
"value": "extern crate pandoc;\n\nuse std::path::PathBuf;\n\n#[test]\nfn creation() {\n use pandoc::PandocOption::*;\n use pandoc::OutputKind;\n let mut pandoc = pandoc::new();\n\n pandoc.add_input(\"cake\");... | rust | chosen |
[
{
"from": "system",
"value": "Add buffer binder fields to `Context`\n"
},
{
"from": "human",
"value": "use std::mem;\nuse super::gl;\nuse super::gl_lib::types::*;\nuse super::Buffer;\n\npub struct Context;\n\nimpl Context {\n pub unsafe fn current_context() -> Self {\n Context\n }\n... | rust | chosen |
[
{
"from": "system",
"value": "Fix erronous error with call to write\n"
},
{
"from": "human",
"value": "#![allow(deprecated)]\n\nuse std::fs::File;\nuse std::hash::{Hash, Hasher, SipHasher};\nuse std::io::Read;\n\npub fn to_hex(num: u64) -> String {\n hex::encode(&[\n (num >> 0) as u8,\... | rust | chosen |
[
{
"from": "system",
"value": "Fix bug in `HistoryHinter` when `ctx.history_index()` is 0\n\nRunning the example without a `history.txt` file on the current master lead to the following error: \r\n```\r\nthread 'main' panicked at 'attempt to subtract with overflow', src\\hint.rs:26:13 note: Run with `RUST_BA... | rust | chosen |
[
{
"from": "system",
"value": "Add method to retrieve content from Post\n"
},
{
"from": "human",
"value": "use std::collections::HashMap;\n\n#[deriving(PartialEq, Show)]\npub struct Post {\n header: HashMap<String, String>,\n content: String\n}\n\nimpl Post {\n pub fn new(header: HashMap... | rust | chosen |
[
{
"from": "system",
"value": "Remove unnecessary Path::new, and use AsPath overloading instead\n"
},
{
"from": "human",
"value": "use engine::{Actor, Map};\nuse util::units::{Direction, Point};\n\nuse std::path::Path;\n\npub struct World {\n pub player: Actor,\n pub actors: Vec<Actor>,\n ... | rust | chosen |
[
{
"from": "system",
"value": "Change prompt for REPL to say \"tf\" instead of \"bf\"\n"
},
{
"from": "human",
"value": "mod vm;\nmod command;\nmod parse;\nmod program;\n\nuse std::io::{Write, Read};\nuse std::env;\nuse std::path::Path;\nuse std::fs::File;\n\nuse vm::VM;\nuse program::Program;\nu... | rust | chosen |
[
{
"from": "system",
"value": ":sparkles: Make possible to recevie commands\n\n"
},
{
"from": "human",
"value": "fn main() {\n println!(\"Hello, world!\");\n}\n"
},
{
"from": "gpt",
"value": "extern crate clap;\n#[macro_use]\nextern crate serde_derive;\nextern crate serde_json;\nex... | rust | chosen |
[
{
"from": "system",
"value": "Add MetricHolder::new() and use LinkedList\n"
},
{
"from": "human",
"value": "extern crate rand;\n\nconst N: usize = 3;\n\nstruct MetricHolder {\n // TODO: make N a part of the metric holder and use a vector\n // also improve by persisting the sum instead of d... | rust | chosen |
[
{
"from": "system",
"value": "Use vec of subcommands for future.\n"
},
{
"from": "human",
"value": "\nextern crate mprovision;\nextern crate clap;\n\nuse std::fs;\nuse clap::{Arg, App, AppSettings, SubCommand};\n\nfn main() {\n let count_subcommand = SubCommand::with_name(\"count\")\n ... | rust | chosen |
[
{
"from": "system",
"value": "Use traits and type specifiable\n"
},
{
"from": "human",
"value": "pub struct Gauge<T> {\n pub value: T\n}\n\n\nimpl<T> Gauge<T> {\n pub fn update(&mut self, value: T) {\n self.value = value\n }\n\n pub fn snapshot(self) -> Gauge<T> {\n Gau... | rust | chosen |
[
{
"from": "system",
"value": "Set twitter poll back to railinfo\n"
},
{
"from": "human",
"value": "extern crate iron;\n#[macro_use]\nextern crate router;\nextern crate dotenv;\nextern crate sbb_telegram_bot;\n\nuse dotenv::dotenv;\nuse iron::prelude::*;\nuse sbb_telegram_bot::route;\nuse sbb_tel... | rust | chosen |
[
{
"from": "system",
"value": "Implement tournament selection to obtain some convergence\n"
},
{
"from": "human",
"value": "extern crate rand;\n\nuse rand::thread_rng;\nuse rand::distributions::Range;\nuse individual::Individual;\n\nmod individual;\n\nfn main() {\n let mut rng = thread_rng();\... | rust | chosen |
[
{
"from": "system",
"value": "Fix warning about unstable library features"
},
{
"from": "human",
"value": "// This code is editable and runnable!\nfn main() {\n // A simple integer calculator:\n // `+` or `-` means add or subtract by 1\n // `*` or `/` means multiply or divide by 2\n\n ... | rust | chosen |
[
{
"from": "system",
"value": "Remove a now-extraneous `use std`\n"
},
{
"from": "human",
"value": "// Copyright (c) 2015-2016 William (B.J.) Snow Orvis\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... | rust | chosen |
[
{
"from": "system",
"value": "Update wav mirror to new api\n"
},
{
"from": "human",
"value": "//! Reads input from a microphone and mirrors it to a speaker ad nauseum.\n\nextern crate oxcable;\n\n#[cfg(not(test))]\nfn main() {\n use oxcable::types::Device;\n use oxcable::io::wav;\n prin... | rust | chosen |
[
{
"from": "system",
"value": "Fix some unused warnings with the latest rustc compiler\n"
},
{
"from": "human",
"value": "// vim: tw=80\n//! bare functions can use non-public types, as long as the object's visibility is compatible.\n\n// mocking modules requires the proc_macro_hygiene feature in ... | rust | chosen |
[
{
"from": "system",
"value": "Disable HPET use on x86\n"
},
{
"from": "human",
"value": "pub mod cpu;\npub mod ioapic;\npub mod local_apic;\npub mod pic;\npub mod pit;\npub mod rtc;\npub mod serial;\n#[cfg(feature = \"acpi\")]\npub mod hpet;\n#[cfg(feature = \"system76_ec_debug\")]\npub mod syst... | rust | chosen |
[
{
"from": "system",
"value": "Make read_file and write_file take generic paths\n"
},
{
"from": "human",
"value": "use std::io;\nuse std::io::{Read, Write};\nuse std::fs::File;\n\n\npub fn write_file(filename: &str, contents: &Vec<u8>) -> io::Result<()> {\n let mut file = try!(File::create(fil... | rust | chosen |
[
{
"from": "system",
"value": "chore: Fix the path in the fmt_repl test\n"
},
{
"from": "human",
"value": "#[macro_use]\nextern crate pretty_assertions;\n\nuse std::fs::File;\nuse std::io::Read;\nuse std::process::Command;\n\n#[test]\nfn fmt_repl() {\n let source = \"src/repl.glu\";\n\n let... | rust | chosen |
[
{
"from": "system",
"value": "Fix deprecation warnings with 1.39.0\n\nSigned-off-by: Josh Black <2831680e59d3b8be5b278b69b4e783c575edf378@gmail.com>\n"
},
{
"from": "human",
"value": "use std::{ffi::CStr,\n mem};\n\nuse libc;\n\nuse crate::{error::{Error,\n Result},\n... | rust | chosen |
[
{
"from": "system",
"value": "bitstream: Add tagl and tagb macros\n\nThey are yet another building block useful to write demuxers.\n"
},
{
"from": "human",
"value": "pub mod bitread;\npub mod byteread;\npub mod bytewrite;\n\n"
},
{
"from": "gpt",
"value": "pub mod bitread;\npub mod b... | rust | chosen |
[
{
"from": "system",
"value": "Improve scrabble by removing unnecessary String::from()\n"
},
{
"from": "human",
"value": "fn value(c: char) -> u32 {\n match c {\n 'a' | 'e' | 'i' | 'o' | 'u' | 'l' | 'n' | 'r' | 's' | 't' => 1,\n 'd' | 'g' => 2,\n 'b' | 'c' | 'm' | 'p' => 3... | rust | chosen |
[
{
"from": "system",
"value": "Add an example of using newline\n"
},
{
"from": "human",
"value": "use rustyline::validate::MatchingBracketValidator;\nuse rustyline::{Editor, Result};\nuse rustyline_derive::{Completer, Helper, Highlighter, Hinter, Validator};\n\n#[derive(Completer, Helper, Highlig... | rust | chosen |
[
{
"from": "system",
"value": "Fix Bug in PNG Encoding\n"
},
{
"from": "human",
"value": "use std::marker::PhantomData;\n\n#[derive(Copy, Clone)]\npub enum ColorType {\n RGBA(u8),\n}\npub struct ImageBuffer<T, U = ()>(U, PhantomData<T>);\npub struct Rgba<T>(PhantomData<T>);\n\npub mod png {\n ... | rust | chosen |
[
{
"from": "system",
"value": "Print out connection rates in the server\n"
},
{
"from": "human",
"value": "use std::env;\nuse std::io::*;\nuse std::net::*;\n\nfn main() {\n let addr = env::args().nth(1).unwrap_or(\"127.0.0.1:12345\".to_string());\n let addr = addr.parse::<SocketAddr>().unwr... | rust | chosen |
[
{
"from": "system",
"value": "Add three basic execute cases\n"
},
{
"from": "human",
"value": "use command::Command;\nuse vm::VM;\n\n\npub struct Program {\n instructions: Vec<Command>,\n instruction_pointer: Option<usize>,\n current_depth: u64,\n pub status: ProgramStatus,\n}\n\n#[d... | rust | chosen |
[
{
"from": "system",
"value": "Remove deleted pass from rustdoc test suite\n\n`src/test/rustdoc-ui/deprecated-attrs.rs`\ntells rustdoc to run the `collapse-docs` pass, which no longer exists\n(it was removed in https://github.com/rust-lang/rust/pull/80261).\nRustdoc doesn't actually give a proper diagnostic ... | rust | chosen |
[
{
"from": "system",
"value": "Use issue = \"none\" instead of \"0\"\n"
},
{
"from": "human",
"value": "#![feature(staged_api)]\n#![feature(test)]\n#![unstable(feature = \"test\", issue = \"0\")]\n\nextern crate test;\n\npub use test::*;\n\npub fn custom_api() {\n}\n"
},
{
"from": "gpt",
... | rust | chosen |
[
{
"from": "system",
"value": "Remove unused `fs` feature gate\n"
},
{
"from": "human",
"value": "#![feature(collections, fs, io, path)]\n\nextern crate tcod;\n\npub mod engine;\npub mod gui;\npub mod util;\n"
},
{
"from": "gpt",
"value": "#![feature(collections, io, path)]\n\nextern ... | rust | chosen |
[
{
"from": "system",
"value": "Remove unused macro_rules feature attribute\n"
},
{
"from": "human",
"value": "#![feature(macro_rules)]\n#![feature(unboxed_closures)]\n\nuse std::fmt;\n\npub use api::IntoLogger;\npub use api::Logger;\npub use config::Logger as LoggerConfig;\npub use config::Output... | rust | chosen |
[
{
"from": "system",
"value": "Use the `$crate` inside `skip_bytes`\n\nThis will allow anyone to use the macro without needing to import\n`IResult`, `Err`, or `ErrorCode`.\n"
},
{
"from": "human",
"value": "macro_rules! skip_bytes (\n ($input: expr, $length: expr, $offset: expr) => (\n {\n ... | rust | chosen |
[
{
"from": "system",
"value": "Move IP protocols to associated constants\n"
},
{
"from": "human",
"value": "/// Represents the eight bit header field in IPv4/IPv6 that defines what protocol the payload has.\n/// See [this list] for the full definition.\n///\n/// [this list]: https://en.wikipedia.... | rust | chosen |
[
{
"from": "system",
"value": "Add rustdoc for staged columns\n"
},
{
"from": "human",
"value": "//! Provides drilldown related procedures.\n//! This module will be used with `SelectCommand` type by `+` operation\n//! to concatinate `select` and `drilldown` queries.\n//!\n//! Also this module sup... | rust | chosen |
[
{
"from": "system",
"value": "Use the `issue-1567` dependency in the test\n"
},
{
"from": "human",
"value": "/// Doc-test test\n/// ```rust\n/// assert!(cargo_miri_test::make_true());\n/// ```\npub fn make_true() -> bool {\n issue_1705::use_the_dependency();\n issue_1691::use_me()\n}\n"
... | rust | chosen |
[
{
"from": "system",
"value": "Add current time in RequestLogger\n"
},
{
"from": "human",
"value": "extern crate iron;\nextern crate time;\n\nuse iron::prelude::*;\nuse iron::{BeforeMiddleware, AfterMiddleware, typemap};\nuse time::precise_time_ns;\n\npub struct RequestLogger;\n\nimpl typemap::Ke... | rust | chosen |
[
{
"from": "system",
"value": "Remove mut warning for empty macro\n"
},
{
"from": "human",
"value": "#[macro_export]\nmacro_rules! bson {\n ([$($val:tt),*]) => {{\n let mut array = Vec::new();\n\n $(\n array.push(bson!($val));\n )*\n\n $crate::Bson::Array... | rust | chosen |
[
{
"from": "system",
"value": "Fix SOAP request mime type\n"
},
{
"from": "human",
"value": "use hyper::header::{CONTENT_LENGTH, CONTENT_TYPE};\nuse hyper::{Request, Body, client::Client};\n\nuse crate::errors::RequestError;\n\n#[derive(Clone, Debug)]\npub struct Action(String);\n\nimpl Action {\... | rust | chosen |
[
{
"from": "system",
"value": "Write tests for the flag collection utility.\n"
},
{
"from": "human",
"value": "// 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\nu... | rust | chosen |
[
{
"from": "system",
"value": ":sparkles: Make possible to load config file\n\n"
},
{
"from": "human",
"value": "extern crate toml;\nuse config::Config;\n\npub struct Workflow {\n config: Config,\n}\n\npub fn new() -> Workflow {\n let config = load_config();\n Workflow {\n config:... | rust | chosen |
[
{
"from": "system",
"value": "Make CachedStateFlags u8 to save space in jit_cache_array\n"
},
{
"from": "human",
"value": "#[derive(Copy, Clone, PartialEq, Eq)]\npub struct CachedStateFlags(u32);\n\nimpl CachedStateFlags {\n const MASK_IS_32: u32 = 1 << 0;\n const MASK_SS32: u32 = 1 << 1;\... | rust | chosen |
[
{
"from": "system",
"value": "Implement reading one character (bump)\n"
},
{
"from": "human",
"value": "pub fn compile(sass: String, style: &str) -> String {\n let parsed = SassReader::new(sass).parse();\n match style {\n \"nested\" => nested(parsed),\n \"compressed\" => ... | rust | chosen |
[
{
"from": "system",
"value": "Add documentation for type information of iter\n"
},
{
"from": "human",
"value": "//! An implementation of [FLAC](https://xiph.org/flac), free lossless audio\n//! codec, written in Rust.\n//!\n//! The code is available on [GitHub](https://github.com/sourrust/flac).\... | rust | chosen |
[
{
"from": "system",
"value": "Make Rsp a unit struct\n"
},
{
"from": "human",
"value": "#[derive(Default)]\npub struct Rsp {\n _dummy: i32\n}\n\nimpl Rsp {\n // TODO: Read general regs\n pub fn read_status_reg(&self) -> u32 {\n 0 // TODO: Properly implement this\n }\n}\n"
},... | rust | chosen |
[
{
"from": "system",
"value": "Add note about using different hashers\n"
},
{
"from": "human",
"value": "use std::collections::HashMap;\n\nfn main() {\n let mut scores = HashMap::new();\n scores.insert(String::from(\"Blue\"), 10);\n scores.insert(String::from(\"Yellow\"), 50);\n\n let... | rust | chosen |
[
{
"from": "system",
"value": "Remove unnecessary type hint from RNA Transcription\n"
},
{
"from": "human",
"value": "use std::iter::FromIterator;\n\n#[derive(PartialEq, Debug)]\npub struct RibonucleicAcid(String);\n\nimpl RibonucleicAcid {\n pub fn new(rna: &str) -> RibonucleicAcid {\n ... | rust | chosen |
[
{
"from": "system",
"value": "Add `black_box` calls to avoid f64 generation disappearing.\n\nThe final steps of generating an `f64` are fairly pure, and LLVM can see\nthis, so it just removes it, since the result is unused. The `black_box`\nfunction is designed to manually overcome this, making the benchmar... | rust | chosen |
[
{
"from": "system",
"value": "Add Bpchar type aliased to VarChar\n"
},
{
"from": "human",
"value": "mod array;\npub mod date_and_time;\npub mod floats;\nmod integers;\nmod primitives;\n#[cfg(feature = \"uuid\")]\nmod uuid;\n\n#[doc(hidden)]\npub mod sql_types {\n #[derive(Debug, Clone, Copy, ... | rust | chosen |
[
{
"from": "system",
"value": "Fix comment referring to formerly-above code\n"
},
{
"from": "human",
"value": "use crate::rc::Rc;\nuse crate::sync::Arc;\nuse core::panic::{RefUnwindSafe, UnwindSafe};\n\n// not covered via the Shared impl above b/c the inner contents use\n// Cell/AtomicUsize, but ... | rust | chosen |
[
{
"from": "system",
"value": "Add a log (MessageList) to the Game\n"
},
{
"from": "human",
"value": "use engine::World;\n\npub struct Game {\n pub world: World,\n}\n\nimpl Game {\n\n pub fn new() -> Game {\n Game {\n world: World::new(),\n }\n }\n\n pub fn st... | rust | chosen |
[
{
"from": "system",
"value": "Implement IntoSV for Option<T: IntoSV>\n"
},
{
"from": "human",
"value": "//! Traits for converting to and from Perl scalars.\n\nuse std::fmt::Display;\nuse raw;\nuse SV;\n\n/// Fast unsafe conversion from raw SV pointer.\npub trait FromSV {\n /// Perform the con... | rust | chosen |
[
{
"from": "system",
"value": "Make the QT location more dynamic\n\n"
},
{
"from": "human",
"value": "fn main() {\n println!(\"cargo:rustc-link-search=framework=/usr/local/opt/qt5/Frameworks\");\n println!(\"cargo:rustc-link-lib=c++\");\n}\n"
},
{
"from": "gpt",
"value": "use st... | rust | chosen |
[
{
"from": "system",
"value": "Fix wrong inner comment in evallib\n"
},
{
"from": "human",
"value": "/// Modules to help creating a problem.\n///\n/// TODO\n\npub mod autoio;\npub mod batch;\npub mod bios;\npub mod dce;\npub mod diff;\npub mod make;\n"
},
{
"from": "gpt",
"value": "//... | rust | chosen |
[
{
"from": "system",
"value": "Print the usage if the command is bad.\n"
},
{
"from": "human",
"value": "use getopts::{getopts};\nuse help;\n\nfn verify_command(command: &str) -> bool {\n match command {\n \"new\" => true,\n \"open\" => true,\n _ => false\n }\n}\n... | rust | chosen |
[
{
"from": "system",
"value": "Use slices for input and output\n"
},
{
"from": "human",
"value": "\n// use std::fmt::Debug;\n\n// pub fn insertion_sort<T: Debug>(array: &mut Vec<T>) {\npub fn insertion_sort(array: &mut Vec<f64>) {\n let n = array.len();\n\n if n > 1 {\n println!(\" ... | rust | chosen |
[
{
"from": "system",
"value": "Use Cryptographically Secure PRNG instead of Rng\n\nAs stated in the Rust documentation:\n\n> An application that requires an entropy source for cryptographic purposes\n> must use OsRng, which reads randomness from the source that the operating\n> system provides (e.g. /dev/ura... | rust | chosen |
[
{
"from": "system",
"value": "Remove unused arguments for the time being.\n"
},
{
"from": "human",
"value": "// STD Dependencies -----------------------------------------------------------\nuse std::fs::File;\n\n\n// Internal Dependencies ------------------------------------------------------\nu... | rust | chosen |
[
{
"from": "system",
"value": "Add note on why integration test is ignored, check token and expiration for instance profile integration test.\n"
},
{
"from": "human",
"value": "extern crate tokio_core;\n\nuse rusoto_credential::{InstanceMetadataProvider, ProvideAwsCredentials};\nuse std::time::Du... | rust | chosen |
[
{
"from": "system",
"value": "Rename the Scene constructor to Scene::new\n"
},
{
"from": "human",
"value": "// 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-... | rust | chosen |
[
{
"from": "system",
"value": "Update rustdoc test to make it work with newly added rustc passes\n"
},
{
"from": "human",
"value": "#![crate_name = \"foo\"]\n\n#![feature(staged_api)]\n\n#[stable(feature = \"bar\", since = \"OLD 1.0\")]\npub trait Bar {}\n\n#[stable(feature = \"baz\", since = \"O... | rust | chosen |
[
{
"from": "system",
"value": "Test allowing individual struct field\n"
},
{
"from": "human",
"value": " // aux-build:priv_dep.rs\n // aux-build:pub_dep.rs\n // compile-flags: --extern-private priv_dep\n#![deny(exported_private_dependencies)]\n\n// This crate is a private dependency\nextern crate... | rust | chosen |
[
{
"from": "system",
"value": "Add some more doc on fault handling issues and lack of work stealing\n"
},
{
"from": "human",
"value": "//! The distrib module provides methods for executing the rendering in a\n//! distributed environment across multiple nodes. The worker module provides\n//! the W... | rust | chosen |
[
{
"from": "system",
"value": "Test dynamic and native regexps at stage2.\n"
},
{
"from": "human",
"value": "// 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 ... | rust | chosen |
[
{
"from": "system",
"value": "Fix module name for path parameter\n"
},
{
"from": "human",
"value": "#![feature(associated_consts)]\n#![feature(type_ascription)]\n#![feature(use_extern_macros)]\n#![allow(plugin_as_library)]\n\n#[macro_use]\nextern crate tapioca;\n\ninfer_api!(httpbin, \"https://r... | rust | chosen |
[
{
"from": "system",
"value": "Add history and env to repl.\n"
},
{
"from": "human",
"value": "// Copyright (c) 2016, Matthew O'Connor\nextern crate system_zero_core;\n\nuse std::io;\nuse std::io::{BufRead, Write};\nuse system_zero_core::*;\nuse system_zero_core::ast::*;\n\nconst PROMPT: &'static... | rust | chosen |
[
{
"from": "system",
"value": "Remove printing the secret number\n"
},
{
"from": "human",
"value": "extern crate rand;\n\nuse std::io;\nuse std::cmp::Ordering;\nuse rand::Rng;\n\nfn main() {\n println!(\"Hello in my guessing game!\");\n\n let secret_number = rand::thread_rng().gen_range(1, ... | rust | chosen |
[
{
"from": "system",
"value": "Add some more common String/&str idioms\n"
},
{
"from": "human",
"value": "// Ok, here are a bunch of values-- some are `Strings`, some are `&strs`. Your\n// task is to call one of these two functions on each value depending on what\n// you think each value is. That... | rust | chosen |
[
{
"from": "system",
"value": "Test function has been renamed\n"
},
{
"from": "human",
"value": "#[macro_use] extern crate match_any;\n\nuse std::any::Any;\n\nfn make_any<T: Any>(value: T) -> Box<Any> {\n Box::new(value)\n}\n\n#[test]\nfn empty() {\n match_any!(make_any(10) => \n x: ... | rust | chosen |
[
{
"from": "system",
"value": "Use the s-expression printing in the REPL\n"
},
{
"from": "human",
"value": "use cell_gc;\nuse parser::parse;\nuse std::io::{self, Write};\nuse vm;\n\npub fn repl() -> io::Result<()> {\n cell_gc::with_heap(|hs| {\n let env = vm::Value::default_env(hs);\n\n... | rust | chosen |
[
{
"from": "system",
"value": "Remove print on game exit\n"
},
{
"from": "human",
"value": "extern crate json;\nextern crate tiled;\n\nextern crate cgmath;\n#[macro_use]\nextern crate gfx;\nextern crate specs;\nextern crate genmesh;\nextern crate gfx_device_gl;\nextern crate gfx_window_glutin;\ne... | rust | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.