hexsha
stringlengths
40
40
size
int64
4
1.05M
content
stringlengths
4
1.05M
avg_line_length
float64
1.33
100
max_line_length
int64
1
1k
alphanum_fraction
float64
0.25
1
3a26974e02ad85f34de54b296961d7f77cea94c4
7,167
//! Defines traits for blocking (synchronous) and non-blocking (asynchronous) //! communication with a Solana server as well a a trait that encompasses both. //! //! //! Synchronous implementations are expected to create transactions, sign them, and send //! them with multiple retries, updating blockhashes and resignin...
34.623188
117
0.665829
16e7634bae7a06ef187a5889ee60e62268f4864c
11,079
use std::collections::HashMap; use actix_web::http::StatusCode; use actix_web::HttpResponse; use actix_web::ResponseError; use chrono::DateTime; use chrono::Utc; use failure::Fail; use failure::ResultExt; use opentracingrust::ExtractFormat; use opentracingrust::InjectFormat; use opentracingrust::Span; use opentracingr...
30.604972
94
0.636429
8ab042fe3e695da2bc1add40e3dadb9829399b42
66
pub mod list; pub mod routes; pub use list::*; pub use routes::*;
13.2
18
0.666667
212b9b7fdce4f8a327883986119223450eb17295
38,385
use std::sync::{Condvar, Mutex}; use std::sync::atomic::{AtomicBool, AtomicUsize}; #[cfg(target_pointer_width = "32")] use std::sync::atomic::AtomicI64; #[cfg(target_pointer_width = "64")] use std::sync::atomic::AtomicIsize; use std::sync::atomic::Ordering::SeqCst; #[cfg(feature = "failpoints")] use std::sync::atomic:...
31.907731
96
0.516504
90bd78be76c51472bcc9fa3a76d395a751020984
782
use super::Identifier; use grin_core::ser; /// Map of named accounts to BIP32 paths #[derive(Clone, Debug, Serialize, Deserialize)] pub struct AcctPathMapping { /// label used by user pub label: String, /// Corresponding parent BIP32 derivation path pub path: Identifier, } impl ser::Writeable for Acct...
31.28
93
0.675192
abb0ced4d64976bf92a1b6e4005cb908e99197b4
8,833
macro_rules! aead_module (($seal_name:ident, $open_name:ident, $seal_detached_name:ident, $open_detached_name:ident, $keybytes:expr, $noncebytes:expr, $tagbyt...
31.434164
107
0.497906
fe87438cce6bf015f10bec5443999b8958233d7e
3,370
/* Copyright 2021 JFrog Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
35.851064
91
0.657864
edddb7e6b314b0262e5e113edfe1ba759cf4f67c
105,576
use crate::binemit::Reloc; use crate::ir::immediates::{Ieee32, Ieee64}; use crate::ir::TrapCode; use crate::isa::x64::inst::args::*; use crate::isa::x64::inst::*; use crate::machinst::{inst_common, MachBuffer, MachInstEmit, MachLabel}; use core::convert::TryInto; use log::debug; use regalloc::{Reg, RegClass, Writable};...
38.447196
103
0.463173
91467e3339b9ce41eb67b792968797a713a6b991
13,148
use engine_core::{engine_state, execution}; use engine_test_support::{ internal::{ DeployItemBuilder, ExecuteRequestBuilder, InMemoryWasmTestBuilder, DEFAULT_GENESIS_CONFIG, DEFAULT_PAYMENT, STANDARD_PAYMENT_CONTRACT, }, DEFAULT_ACCOUNT_ADDR, }; use types::account::{PublicKey, Weight}; cons...
33.20202
98
0.635002
fc25d5ca8322845023f8f4fdf6c86c65b18d8956
2,090
use crate::printer::Printer; use anyhow::{Context, Result}; use log::info; use reinfer_client::{Client, DatasetIdentifier, SourceId, SourceIdentifier, UpdateDataset}; use structopt::StructOpt; /// Update a dataset. #[derive(Debug, StructOpt)] pub struct UpdateDatasetArgs { #[structopt(name = "dataset")] /// Na...
29.027778
91
0.580861
11affb9dfd576bc55921b8ee5b82a4048a2fdbc7
77,910
// Copyright 2012-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-MI...
29.081747
99
0.506597
28455a86926da63f565760ce9035358e3f334a77
86
#[path = "../../tracing/tests/support/mod.rs"] mod support; pub use self::support::*;
21.5
46
0.639535
56cd93d319d52be6e071779f86dfb8b18ca19fa9
2,926
use crate::model::{id::Id, messaging::MessagingMessage}; use crate::streaming::channel::NoOutgoing; use serde::{Deserialize, Serialize}; #[derive(Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase", tag = "type", content = "body")] pub enum MessagingIndexStreamEvent { Message(MessagingMessage), Read(...
30.164948
80
0.516405
f92850b0658269696ff84a51cc2df8d1252f2dee
46,299
// Copyright © 2019 The Rust Fuzz Project Developers. // // 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 http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed...
31.346649
108
0.519061
c138ec0d9150cba4145cdeedded6d1e642d39681
448
#![no_main] use arbitrary::Unstructured; use libfuzzer_sys::fuzz_target; fuzz_target!(|bytes: &[u8]| { let mut u = Unstructured::new(bytes); let (bytes, _config) = match wasm_tools_fuzz::generate_valid_module(&mut u, |_, _| Ok(())) { Ok(m) => m, Err(_) => return, }; // Print the Wasm ...
24.888889
96
0.591518
4a84aeb0a68f21979a80aca7eda8c2cd4bb945cb
2,497
use core::convert::TryInto; use core::marker::PhantomData; use embedded_hal::blocking::i2c::{Write, WriteRead}; pub const LSM_MAG_I2C_ADDR: u8 = 0b001_1110; #[allow(non_camel_case_types)] pub struct LSM303LDHC_MAG<TI2C> { phantom: PhantomData<TI2C>, } #[derive(Clone, Debug)] #[repr(u8)] #[allow(dead_code)] pub e...
27.141304
99
0.603925
5da133a31262a168572a4960a6fdafc59088a12b
6,076
// 3D Projective Geometric Algebra // Written by a generator written by enki. #![allow(unused_imports)] #![allow(dead_code)] #![allow(non_upper_case_globals)] #![allow(non_snake_case)] #![allow(non_camel_case_types)] #![feature(const_slice_len)] use std::fmt; use std::ops::{Index,IndexMut,Add,Sub,Mul,BitAnd,BitOr,BitX...
20.119205
95
0.493417
18c9d28822096dea2e87f99c5b33f3c06643242e
6,844
//! Manipulate lines of text and groups of lines. use crate::positions::SingleLineSpan; use lazy_static::lazy_static; use regex::Regex; use std::{cmp::max, fmt}; /// A distinct number type for line numbers, to prevent confusion with /// other numerical data. /// /// Zero-indexed internally. #[derive(Clone, Copy, Part...
27.266932
95
0.527031
bf2b24066a1f9d3e3a64c9bc2ca803b6c4fa481d
4,589
#![cfg(all(test, feature = "test_e2e"))] mod setup; use azure_core::prelude::*; use azure_cosmos::prelude::*; use azure_cosmos::resources::collection::*; #[tokio::test] async fn create_and_delete_collection() { const DATABASE_NAME: &str = "test-cosmos-db-create-and-delete-collection"; const COLLECTION_NAME: &...
29.993464
106
0.633253
d7a6bd42ceef0a1ab54ae513c5d61b17f5dd1d7d
2,174
mod base; use crate::base::{ destroy, new_mma8451, new_mma8452, new_mma8453, new_mma8652, new_mma8653, BitFlags as BF, Register, ADDRESS, }; use embedded_hal_mock::i2c::Transaction as I2cTrans; use mma8x5x::DataStatus; macro_rules! get_data_status { ($name:ident, $create:ident, $bit_flag:ident, $status_fla...
30.194444
98
0.49494
c16cec457709b0cc843321bbdff7d9318841be97
1,005
#[derive(Clone, Copy, Debug)] pub enum EntityError { None, BareError, VerifyFailed, InvalidInternalState, InvalidProof, ConsistencyError, ComplexEventsAreNotSupported, EventIdDoesntMatch, ProfileIdDoesntMatch, EmptyChange, ContactNotFound, EventNotFound, InvalidChainS...
25.125
57
0.695522
b9a172a8163c39663c1f3997b604369e6b18bfaf
15,237
use image::{ImageResult, RgbImage}; use mli::{Backward, Forward, Graph, Train}; use mli_conv::{Conv2n, Conv3}; use mli_defconv::DefConv2InternalOffsets; use mli_dense::Dense2; use mli_ndarray::{Map1One, Map2One, Map3One, Reshape3to2}; use mli_relu::Blu; use mli_sigmoid::Logistic; use mnist::{Mnist, MnistBuilder}; use n...
42.442897
128
0.514734
ab429255381664f06886123123d985fd84186720
16,753
//! Multi probe LSH use crate::data::{Integer, Numeric}; use crate::{prelude::*, utils::create_rng}; use fnv::FnvHashSet; use itertools::Itertools; use ndarray::prelude::*; use ndarray::stack; use num::{Float, One, Zero}; use rand::distributions::Uniform; use rand::seq::SliceRandom; use rand::Rng; use statrs::function:...
32.84902
111
0.511789
efda3b263cc97fae94f08fb2dda1522424763779
15,001
use crate::convert::TryFrom; use crate::mem; use crate::ops::{self, Add, Sub, Try}; use crate::usize; use super::{FusedIterator, TrustedLen}; /// Objects that can be stepped over in both directions. /// /// The `steps_between` function provides a way to efficiently compare /// two `Step` objects. #[unstable(feature =...
29.298828
94
0.500967
89867fb3b1017d7f5d5426d27aa7b58e851c5361
710
//! A simple event queue. This is a resource that stays inside the World and //! is used to store events before they're processed by the game state. use super::GameEvent; use std::collections::VecDeque; #[derive(Default)] pub struct EventQueue { events: VecDeque<Box<dyn GameEvent + Sync + Send>>, } impl EventQu...
24.482759
76
0.635211
d6333cf4c431de4bfc54cf06ee0732ad695d6df1
3,455
#![recursion_limit="128"] mod api_dump; mod database; mod emitter_lua; mod emitter_rust; mod roblox_install; mod run_in_roblox; mod reflection_types; use std::{ collections::HashMap, path::PathBuf, error::Error, }; use serde_derive::Deserialize; use rbx_dom_weak::{RbxTree, RbxValue, RbxInstanceProperties...
25.783582
87
0.606368
1ae9c6ad874102314f91c1e9f958274345ab44a4
10,265
use std::os::unix::io::RawFd; use std::mem; use std::ptr; use libc; use nix; use libc::{c_void, c_ulong, sigset_t, size_t}; use libc::{kill, signal}; use libc::{F_GETFD, F_SETFD, F_DUPFD_CLOEXEC, FD_CLOEXEC, MNT_DETACH}; use libc::{SIG_DFL, SIG_SETMASK}; use run::{ChildInfo, MAX_PID_LEN}; use error::ErrorCode as Err;...
30.918675
85
0.52187
fe5c770138fc718649e5d9d98f1f864830ba7802
233
#![feature(into_cow, associated_type_defaults)] #[macro_use] extern crate log; pub mod sqlsyntax; pub mod tempdb; mod byteutils; mod columnvalueops; mod databaseinfo; mod databasestorage; mod identifier; mod queryplan; mod types;
14.5625
47
0.7897
22a9f9a36e98fb472b393efb6648c099398f7f36
12,859
use coarsetime::{Clock, Duration, UnixTimeStamp}; use ct_codecs::{Base64UrlSafeNoPadding, Encoder}; use rand::RngCore; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use std::collections::HashSet; use std::convert::TryInto; use crate::common::VerificationOptions; use crate::error::*; use crate::serde_addit...
33.486979
122
0.587448
18c450583160c7e6ca3697c9c8a0870090161a36
1,812
use crate::{Bundle, Component, DynamicBundle, Entity, World}; /// Converts a reference to `Self` to a [WorldBuilder] pub trait WorldBuilderSource { fn build(&mut self) -> WorldBuilder; } impl WorldBuilderSource for World { fn build(&mut self) -> WorldBuilder { WorldBuilder { world: self, ...
27.454545
161
0.610375
91dcb62233b07ddc4cd789be979383282c14a31e
428
extern crate reqwest; use crate::config::{base_transaction_service_url, build_number, version}; use crate::models::service::about::About; use crate::utils::errors::ApiResult; pub fn get_about() -> ApiResult<About> { Ok(About { transaction_service_base_url: base_transaction_service_url(), name: env...
28.533333
73
0.693925
ffe25a57a1081b80d40f5d0e795db17efbf18f17
1,330
// Copyright 2021 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
28.297872
75
0.728571
f9bc4420cd69309ab0c94a2d0a4cb8efd01860dc
1,345
extern crate bindgen; use cmake::Config; use std::env; use std::path::PathBuf; fn main() { // Generate bindings for RediSearch let bindings = bindgen::Builder::default() .header("src/include/redisearch_api.h") //.clang_arg("-I src/include") // For redismodule.h .whitelist_var("(RS|Red...
32.804878
101
0.645353
acf0667fd0e463bf7d1828698c297195ab15d5ec
56,725
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
35.232919
336
0.543358
1d267e3266e20354df9395237a1fab49f6ff4eb7
2,596
use clap::ArgMatches; use environment::Environment; use eth2_testnet_config::Eth2TestnetConfig; use genesis::{Eth1Config, Eth1GenesisService}; use std::path::PathBuf; use std::time::Duration; use types::EthSpec; /// Interval between polling the eth1 node for genesis information. pub const ETH1_GENESIS_UPDATE_INTERVAL:...
38.746269
97
0.654083
227858c57989df81851ec1f63b7e09b4a5ffa561
9,379
use futures::future::ok; use std::rc::Rc; use super::{BoxedNewPeerFuture, Peer}; use super::{ConstructParams, PeerConstructor, Specifier}; use std::io::Read; use tokio_io::AsyncRead; use std::io::Error as IoError; #[derive(Debug)] pub struct Message2Line<T: Specifier>(pub T); impl<T: Specifier> Specifier for Messa...
32.230241
122
0.513168
3a4dd14d956e1018313ce8f87f15ce956228fbf9
2,086
use nagamochi::Config; use notify_rust::Notification; use seahorse::{App, Context}; use std::{env, path::PathBuf, time}; fn main() { let args: Vec<String> = env::args().collect(); let app = App::new(env!("CARGO_PKG_NAME")) .description(env!("CARGO_PKG_DESCRIPTION")) .author(env!("CARGO_PKG_AUTH...
34.766667
83
0.499041
c15f29960ac8ff37ee07a28d6a93684548813079
6,665
//! A pool of data required for api tests. // Built-in uses use std::{ cmp::max, collections::{BTreeMap, HashMap, VecDeque}, sync::Arc, }; // External uses use rand::{thread_rng, Rng}; use tokio::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard}; // Workspace uses use zksync_api_client::rest::v1::Paginati...
33.832487
98
0.644561
5dcade81a7da89afd40616d07bb5fb159edb1448
11,254
use crate::capability::native::{normalize_link_name, NativeCapability}; use crate::control_interface::ctlactor::{ControlInterface, PublishEvent}; use crate::dispatch::{Invocation, InvocationResponse, ProviderDispatcher, WasmCloudEntity}; use crate::hlreg::HostLocalSystemService; use crate::messagebus::{EnforceLocalPro...
36.186495
117
0.55287
909c35d64f5486984f122ca2d1b47b6a21d26a8d
6,163
use std::cell::RefCell; use std::mem::drop; use std::ops::Deref; use std::sync::{self, Arc, Mutex}; use once_cell::sync::Lazy; use shredder::*; static TEST_MUTEX: Lazy<parking_lot::Mutex<()>> = Lazy::new(|| parking_lot::Mutex::new(())); #[derive(Debug, Scan)] struct DirectedGraphNode { label: String, edges:...
27.513393
92
0.580561
eb558c5ee44b344f020d4db59fe356cae7605c80
4,237
// Copyright 2016 The pliOS Developers. See the LICENSE // file at the top-level directory of this distribution. // // Licensed under the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>. This file may not // be copied, modified, or distributed except according // to these terms. //! Page frame alloc...
27.875
104
0.590276
f8c9659e5a6c0759653c86e6c0658e48d6a6df9a
23,817
// Licensed under the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed ...
39.237232
100
0.604694
1a0449753e6880875dfe81f8f82a08f50e944bc8
3,080
use std::fmt::Display; use shared::utils; use shared::grid::*; lazy_static! { // static ref INPUT: Vec<String> = utils::read_sample_input_lines("day04"); static ref INPUT: Vec<String> = utils::read_input_lines("day04"); } #[derive(Debug, Default)] struct BingoSquare { num: usize, marked: bool, } im...
25.666667
79
0.493506
8a10699b0fcb689526e24c4ac29a9a9cedab9ffb
6,983
use crate::infrastructure::{config, graphql, repositories, security}; use actix_web::{dev, error, web, Error, FromRequest, HttpRequest, HttpResponse, Result}; use futures_util::future::{FutureExt, LocalBoxFuture}; use graphql_parser::query; use juniper::{http, DefaultScalarValue, InputValue, ScalarValue}; use serde::{D...
31.035556
98
0.529572
8abc8e1c31622be1c0e95df2b65ae326ac3b0e57
15,012
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // https://www.apache.org/licenses/LICENSE-2.0>. // This file may not be copied, modified, or distributed // except according to those terms. use std::fmt; use rand::prelude::*; use rand::distributions::{Normal, Uniform, Weibull, LogNormal, Distribu...
33.810811
124
0.520983
3a64bd8494d59f0661ce8a864cf22b1357f6bbe7
63,472
//! Main module defining the lexer and parser. use crate::engine::{ Precedence, KEYWORD_DEBUG, KEYWORD_EVAL, KEYWORD_FN_PTR, KEYWORD_FN_PTR_CALL, KEYWORD_FN_PTR_CURRY, KEYWORD_IS_DEF_VAR, KEYWORD_PRINT, KEYWORD_THIS, KEYWORD_TYPE_OF, }; use crate::stdlib::{ borrow::Cow, cell::Cell, char, fmt, forma...
31.751876
126
0.436807
decf53ab14090f0a1e3fbe1702b8613f55e4f694
5,124
// Copyright 2020. The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following // disclai...
36.340426
118
0.665105
33cd45328030298773d010cd42263b83856959a2
14,496
//---------------------------------------------------------------------------// // Copyright (c) 2017-2020 Ismael Gutiérrez González. All rights reserved. // // This file is part of the Rusted PackFile Manager (RPFM) project, // which can be found here: https://github.com/Frodo45127/rpfm. // // This file is licensed un...
37.457364
256
0.583126
6425e6a28ece00f03c03184302a59962925caad8
11,555
// Copyright 2012-2013 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-MI...
39.982699
99
0.455647
d940cc8ba897423329492be7629fee1d71e0f014
2,273
use crate::utils::utils_paths::linear_spline_path::LinearSplinePath; use crate::utils::utils_math::interpolation_utils::*; use nalgebra::DVector; #[derive(Clone, Debug)] pub struct ArclengthParameterizationUtil { _distances_to_each_waypoint: Vec<f64>, _length_ratio_to_each_waypoint: Vec<f64>, _total_dis: f...
36.079365
151
0.637923
48c4461ba938324b12dee8ea799fd10739fdee80
473
#![cfg_attr(not(with_main), no_std)] trait Tr { type Result; fn f(&self) -> Self::Result; } struct St(i32); impl Tr for St { type Result = i32; fn f(&self) -> i32 { self.0 } } pub fn f(x: i32) -> i32 { let st = St(100); let tr: &dyn Tr<Result = i32> = &st; tr.f() } pub static ARG: i32 ...
18.192308
84
0.547569
69969db437d6c89da7a05f31515a43673f5a6bfb
1,466
use std::ops::Neg; #[derive(Debug, PartialOrd, PartialEq, Copy, Clone)] pub enum Number { Real(i64), Float(f64), } impl Default for Number { fn default() -> Self { Self::Real(0) } } impl Neg for Number { type Output = Number; fn neg(self) -> Self::Output { match self { ...
19.546667
52
0.431105
3af9c0518924a84323d1a7c0e810b6cc0689a0db
488
// This test case makes sure that the compiler doesn't crash due to a failing // table lookup when a source file is removed. // revisions:cfail1 cfail2 // Note that we specify -g so that the SourceFiles actually get referenced by the // incr. comp. cache: // compile-flags: -Z query-dep-graph -g // compile-pass #![cr...
19.52
81
0.680328
28d140e80846e2ce14f8f3198777a6669d32f863
3,728
use super::{Open, Sink}; use crate::config::AudioFormat; use crate::convert::Converter; use crate::decoder::AudioPacket; use crate::{NUM_CHANNELS, SAMPLE_RATE}; use sdl2::audio::{AudioQueue, AudioSpecDesired}; use std::time::Duration; use std::{io, thread}; pub enum SdlSink { F32(AudioQueue<f32>), S32(AudioQue...
31.066667
92
0.496245
091a8392780a0ee7fd25b4fd12b7729c5151fc04
6,102
use super::worker::Worker; use futures_core::ready; use std::error::Error; use std::fmt; use std::task::Poll; /// Error raised by `blocking`. pub struct BlockingError { _p: (), } /// Enter a blocking section of code. /// /// The `blocking` function annotates a section of code that performs a blocking /// operati...
34.868571
82
0.643232
75d6234d362bf8657e2485d7485501f7fc60e774
148
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 pub mod coverage_map; pub mod source_coverage; pub mod summary;
21.142857
43
0.77027
f81acb267e5a814aaa9b29e32d1c2aca2fdcb11a
1,441
use crate::pack; use git_object::borrowed; use quick_error::quick_error; quick_error! { #[derive(Debug)] pub enum Error { Decode(err: pack::data::decode::Error) { display("Could not decode object") } } } impl pack::Bundle { /// `id` is a 20 byte SHA1 of the object to locate...
30.020833
119
0.515614
5baf1b2ff17227f29c0d98e74610338b767ba3ef
1,486
// Length of the entries in `struct utsname_t` is 65. const UTSNAME_LENGTH: usize = 65; #[repr(C)] #[derive(Clone)] pub struct new_utsname_t { pub sysname: [u8; UTSNAME_LENGTH], pub nodename: [u8; UTSNAME_LENGTH], pub release: [u8; UTSNAME_LENGTH], pub version: [u8; UTSNAME_LENGTH], pub machine: [u...
31.617021
71
0.562584
0989db2f376a3a6f6c20dbaaf9b356b5749a31bc
258
#![ warn( rust_2018_idioms ) ] #![ warn( missing_debug_implementations ) ] #![ warn( missing_docs ) ] // #![ feature( trace_macros ) ] use fundamental_data_type as TheModule; #[ allow( unused_imports ) ] use test_tools::*; #[ path = "./inc.rs" ] mod inc;
19.846154
43
0.658915
4bf1d0ae6ec099c4b430a9ae5b1ca7b8932f79a0
6,146
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::act::ActionContext, crate::metrics::{metric_value::MetricValue, MetricState}, anyhow::{bail, Error}, injectable_time::{Monoton...
47.276923
99
0.6082
71703269eb1c18fd0fddfc52c497263450460899
1,126
fn main() { let number = 6; if number % 4 == 0 { println!("number is divisible by 4"); } else if number % 3 == 0 { println!("number is divisible by 3"); } else if number % 2 == 0 { println!("number is divisible by 2"); } else { println!("number is not divisible by 4,...
17.060606
58
0.478686
76d240bb89f59cfb5dce98a0913ce876046d16d8
17,418
use rustc_data_structures::graph::dominators::Dominators; use rustc_middle::mir::visit::Visitor; use rustc_middle::mir::{BasicBlock, Body, Location, Place, Rvalue}; use rustc_middle::mir::{BorrowKind, Mutability, Operand}; use rustc_middle::mir::{InlineAsmOperand, Terminator, TerminatorKind}; use rustc_middle::mir::{St...
39.586364
99
0.501148
562fff273bf893328a1937c8ad25b56b52b72cae
10,377
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use crate::context::LowpanCtlContext; use anyhow::{format_err, Context as _, Error}; use argh::FromArgs; use fidl::endpoints::create_endpoints; use fidl_fu...
31.929231
92
0.490026
71873bdd9db5122255129d818220b07358b48359
5,966
//! This is a lightweight crate for verifying NUBAN numbers //! for all Nigerian bank accounts as was directed by the CBN. use std::{cell::Cell, collections::HashMap, fmt, sync::Once}; pub const BANKS: [(&'static str, &'static str); 24] = [ ("044", "Access Bank"), ("014", "Afribank"), ("023", "Citibank"),...
30.911917
109
0.556487
28254dd3ecb983308ffdb33291b5f89348e33043
2,262
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. use crate::errors::Result; use crate::properties::DecodeProperties; use crate::range::Range; use crate::CFHandleExt; use std::ops::Deref; pub trait TablePropertiesExt: CFHandleExt { type TablePropertiesCollection: TablePropertiesCollection< ...
26
81
0.673298
d98e37bcf0cfa6d8a737b022b7095f6df6a8a63e
5,197
use std::{ fs::create_dir_all, panic::{catch_unwind, resume_unwind, AssertUnwindSafe}, path::{Path, PathBuf}, }; use serde::de::DeserializeOwned; use swc::{ config::{Config, IsModule, JscConfig, Options, SourceMapsConfig}, Compiler, }; use swc_ecma_ast::EsVersion; use swc_ecma_parser::{Syntax, TsCo...
30.934524
91
0.460843
64220b633e2581c655f60dcc2d646633cb035ab2
1,829
use std::convert::Infallible; use std::error::Error as StdError; use std::fmt; type BoxError = Box<dyn std::error::Error + Send + Sync>; /// Errors that can happen inside warp. pub struct Error { inner: BoxError, } impl Error { pub(crate) fn new<E: Into<BoxError>>(err: E) -> Error { Error { inner: er...
22.8625
84
0.523783
1e4f9f98e3dc2ca7dfb4562f0cc0074d0e7346d2
30,909
use crate::{ paint::{text::cursor::*, *}, util::undoer::Undoer, *, }; #[derive(Clone, Debug, Default)] #[cfg_attr(feature = "persistence", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "persistence", serde(default))] pub(crate) struct State { cursorp: Option<CursorPair>, #[cf...
34.535196
149
0.518393
efae4fc9ca226e2bdd4042a0fe472b12060a8d0e
43,297
//! This module provides translations of unary and binary operator expressions. use super::*; fn neg_expr(arg: P<Expr>) -> P<Expr> { mk().unary_expr(ast::UnOp::Neg, arg) } fn wrapping_neg_expr(arg: P<Expr>) -> P<Expr> { mk().method_call_expr(arg, "wrapping_neg", vec![] as Vec<P<Expr>>) } impl From<c_ast::Bi...
41.392925
120
0.457584
2897c8ac0001e021ad2de73f51779264010dff17
8,155
use crate::finder::structures::{Opts as FinderOpts, SuggestionType}; use crate::hash::fnv; use crate::structures::cheat::VariableMap; use crate::structures::item::Item; use crate::writer::{self, Writer}; use anyhow::{Context, Error}; use regex::Regex; use std::collections::HashSet; use std::io::Write; lazy_static! { ...
33.979167
136
0.507909
bf6d8ebec5095ef675d8c5384eee86ce708318d3
8,630
use std::marker::PhantomData; use crate::drgraph::Graph; use crate::hasher::Hasher; use crate::layered_drgporep::Layers; use crate::parameter_cache::ParameterSetIdentifier; use crate::zigzag_graph::{ZigZag, ZigZagBucketGraph}; /// ZigZagDrgPorep is a layered PoRep which replicates layer by layer. /// Between layers, ...
35.514403
136
0.613441
69a230e2572d087c69664f8b20456656ba9e14ac
2,986
use std::ops::Range; use lasso::Spur; use crate::{source_file::SourceLocation, FileId}; #[derive(Debug, Copy, Clone, PartialEq)] pub enum TokenKind { // Single-character tokens LeftParen, RightParen, LeftBrace, RightBrace, Comma, Dot, Minus, Plus, Percent, SemiColon, S...
19.38961
98
0.508372
5debbddbdc57bfece511afc95d4f417b4868070e
23,552
// Copyright 2018 Parity Technologies (UK) Ltd. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, mer...
37.987097
115
0.550144
fef020b6422de9cf335123bbba436ad8da186fd3
4,104
// Copyright 2018 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
30.626866
87
0.677632
2146742713e68b860d281c0f2303fd5614afff47
7,067
//! Implements low-level bitboard operations. These are fast, but not ergonomic; //! prefer to use abstractions under [`game`] if possible. //! //! Under the hood, all these operations work on u64 bitboards. By convention, //! the MSB is the upper-left of the board, and uses row-major order. use packed_simd::{u64x4, u...
37.791444
100
0.671006
efa7177783fdee2de2e433dd99d94d8ac6a2b8e2
2,520
//!Router asigns handlers to paths and resolves them per request pub use self::http_router::HttpRouter; pub use self::request_handler::{RequestHandler, ResponseFinalizer}; pub use self::router::{Router, Route, RouteResult}; pub mod http_router; pub mod request_handler; pub mod router; /// The path_utils collects some...
45
83
0.55754
505b2237c350439c7ba74d7faaad196db8af6332
8,536
//! ## LineGauge //! //! `LineGauge` is a line gauge /** * MIT License * * tui-realm - Copyright (C) 2021 Christian Visintin * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without ...
31.153285
132
0.550492
896aa29de17e7c1ab6c5ed03d3f9673da48f5e79
4,578
#![allow(dead_code)] #![allow(unused_variables)] #![allow(unused_mut)] pub fn foo() { // strings are implemented as a collection of bytes plus some methods to provide useful // functionality when those bytes are interpreted as text. // the 'str' type represents a string slice, and is usually seen in its b...
38.15
100
0.604412
5bd5c0145fe075c74ce4dc930739ba250a86aa89
410
#[doc = "Reader of register AHBNSPPCEXP1"] pub type R = crate::R<u32, super::AHBNSPPCEXP1>; #[doc = "Writer for register AHBNSPPCEXP1"] pub type W = crate::W<u32, super::AHBNSPPCEXP1>; #[doc = "Register AHBNSPPCEXP1 `reset()`'s with value 0"] impl crate::ResetValue for super::AHBNSPPCEXP1 { type Type = u32; #[i...
27.333333
57
0.643902
8aecb51e5bad98a2f49513c12fced8b358fd5d99
3,625
//! Pure Rust implementation of Ryū, an algorithm to quickly convert floating //! point numbers to decimal strings. //! //! The PLDI'18 paper [*Ryū: fast float-to-string conversion*][paper] by Ulf //! Adams includes a complete correctness proof of the algorithm. The paper is //! available under the creative commons CC-...
32.366071
84
0.630897
f81920be54af934da96070c850dba1fcc7a4b50f
920
//! Generated file, do not edit by hand, see `xtask/codegen` use crate::generated::FormatJsAnyArrayBindingPatternElement; use crate::prelude::*; use rome_js_syntax::JsAnyArrayBindingPatternElement; impl FormatRule<JsAnyArrayBindingPatternElement> for FormatJsAnyArrayBindingPatternElement { type Context = JsFormatC...
43.809524
95
0.686957
3817efb5ae7fb7026c67932cb7c93e204f2c4fe9
4,301
//! An example of decoding multipart form requests extern crate futures; extern crate gotham; extern crate hyper; extern crate mime; extern crate multipart; use futures::{future, Future, Stream}; use gotham::handler::{HandlerFuture, IntoHandlerError}; use gotham::helpers::http::response::create_response; use gotham::...
34.408
96
0.500349
16c78da81c846fce0e972ebf6874c8a852a22dd1
4,920
//! Abstraction over blocking and unblocking the current thread. //! //! Provides an abstraction over blocking the current thread. This is similar to //! the park / unpark constructs provided by [`std`] but made generic. This //! allows embedding custom functionality to perform when the thread is blocked. //! //! A blo...
34.893617
80
0.642683
1ab50d6e872a010fc900445b204ab19a3241b3ab
5,898
//! ## Tools for working with functions //! //! e.g.: //! - chaining //! - composing //! - applying to values //! - supplying arguments //! - currying (O_O) //! - Flipping arguments/output/both //! - Cartesian product of functions //! - Untupling (running a function `A, B -> _` on _argument_ `(A, B)`) //! //! ## DISCLA...
33.896552
133
0.633435
2f863d3da62ac957f1b83a314c35ac4ca71c21c0
675
// xfail-fast // 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 // <...
29.347826
68
0.682963
8a1dea4d99bfed44e1aa40e4ab67fde92f6c79c9
17,533
//! A helper class for dealing with static archives use std::env; use std::ffi::{CStr, CString, OsString}; use std::io; use std::mem; use std::path::{Path, PathBuf}; use std::ptr; use std::str; use crate::llvm::archive_ro::{ArchiveRO, Child}; use crate::llvm::{self, ArchiveKind, LLVMMachineType, LLVMRustCOFFShortExpo...
37.543897
100
0.507671
224b5e50e32d6966193e7eb5bb1d7d1aa815d3e1
8,562
use once_cell::sync::Lazy; use regex::Regex; use crate::config_parser::parse; use crate::letters::*; use crate::ligatures::LIGATURES; use std::collections::HashMap; use std::iter::repeat; static HARAKAT_RE: Lazy<Regex> = Lazy::new(|| { // correct Regex -> safe unwrap Regex::new( "[\u{0610}-\u{061a}\u...
36.746781
156
0.471035
4a0ec7ce169fed882906217cc8f06fa26f72d7c4
586
#[derive(Debug, Serialize, Deserialize, PartialEq)] pub enum r#LogAuthenticationProvider { #[serde(rename = "OKTA_AUTHENTICATION_PROVIDER")] r#OktaAuthenticationProvider, #[serde(rename = "ACTIVE_DIRECTORY")] r#ActiveDirectory, #[serde(rename = "LDAP")] r#Ldap, #[serde(rename = "FEDERATION")...
29.3
84
0.68942
2197538f0115991df909800512563f06c5b8cb2d
2,228
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::*; use libra_crypto; use language_common::{error_codes::*, tooling::fake_executor::Account}; use move_ir::{assert_error_type, assert_no_error}; use libra_types::account_address::AccountAddress; #[test] fn cant_send_transact...
27.85
95
0.695691
d9262c7d973eb41b1622c7feceb0a0df1596378a
6,813
use futures::executor::block_on; use image::ImageFormat; use imgui::*; use imgui_wgpu::Renderer; use imgui_winit_support; use std::time::Instant; use winit::{ dpi::LogicalSize, event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::Window,...
32.442857
100
0.505211
ed574df58435267163d099bbdeabdd845a868d50
6,638
use tokio::sync::mpsc; use tokio::time::Instant; use tracing_futures::Instrument; use crate::core::CandidateState; use crate::core::RaftCore; use crate::core::State; use crate::error::VoteError; use crate::raft::VoteRequest; use crate::raft::VoteResponse; use crate::summary::MessageSummary; use crate::RaftNetwork; use...
37.931429
118
0.559807
edd82b42876aafed6f28f3b768ac331b8e74c8d1
17,726
// 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 ...
34.419417
100
0.530012
0aa3f36d29cbb48dff6d720d42116b67fd8f2ba7
525
// 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 ...
32.8125
68
0.71619
b962e8cf6eb1c0393e2e11dc2e3cf5c10e61273e
3,366
use crate as btc_relay; use crate::{Config, Error}; use frame_support::{parameter_types, traits::GenesisBuild}; use mocktopus::mocking::clear_mocks; use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, }; pub const BITCOIN_CONFIRMATIONS: u32 = 6; pub const PARACHAIN_CONF...
26.296875
98
0.669935
75f29ea64674c6104ae956f5adff9302bfe8573b
3,990
#[doc = "Register `NVIC_ISER` reader"] pub struct R(crate::R<NVIC_ISER_SPEC>); impl core::ops::Deref for R { type Target = crate::R<NVIC_ISER_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<NVIC_ISER_SPEC>> for R { #[inline(always)] fn from(read...
30
300
0.627318
ffccb4ce26f022a1f00091e65f8be01c1184b4a7
45,546
#[doc = "Register `PPS` reader"] pub struct R(crate::R<PPS_SPEC>); impl core::ops::Deref for R { type Target = crate::R<PPS_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<PPS_SPEC>> for R { #[inline(always)] fn from(reader: crate::R<PPS_SPEC>) ...
29.290032
414
0.549928
f8b9d37a5cc4e757efe2960f1a1a804a62e839cd
113
// run-rustfix #![warn(clippy::redundant_closure_call)] #![allow(unused)] fn main() { let a = (|| 42)(); }
12.555556
40
0.575221
29f538f3d58240b406ca9cbba923c4f5231cfbba
234
//! Communication backends for [clients] to connect to the node software. //! //! These are pluggable and reusable modules wrapping specific libraries that perform network //! requests. //! //! [clients]: crate::client pub mod http;
26
93
0.730769
1d27f73a2e2795c7c235c1dae5c74e4cbf605bfe
4,012
use intcode_computer::Computer; fn main() { challenge_1(); challenge_2(); } fn challenge_1() { let computer = Computer::load_from_file("input"); println!( "Challenge 1: Number of points affected by tractor beam = {}", points_in_tractor_beam(computer, (50, 50)) ); } fn challenge_2(...
31.34375
83
0.686441
ff3ea7501550360aa9c21ace91fdadde90d15bad
70,660
// This file is generated by rust-protobuf 2.25.1. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy::all)] #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] #![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #!...
34.518808
155
0.591424