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
1dfb242e71f3199c5362e54b150986a015f398b9
12,675
use std::future::Future; /// A lobste.rs request made as part of a workload. /// /// Trawler generates requests of this type that correspond to "real" lobste.rs website requests. /// /// Trawler does not check that the implementor correctly perform the queries corresponding to each /// request; this must be verified w...
38.063063
102
0.553846
9b4120a0a75cd70b2d375549fb7778e747ac3436
14,318
use crate::key_info::{KeyInfo, X509Data}; use quick_xml::events::{BytesEnd, BytesStart, BytesText, Event}; use quick_xml::Writer; use serde::Deserialize; use std::io::Cursor; const NAME: &str = "ds:Signature"; const SCHEMA: (&str, &str) = ("xmlns:ds", "http://www.w3.org/2000/09/xmldsig#"); #[derive(Clone, Debug, Dese...
36.52551
98
0.587233
29bcc265652708a66ede3ef64188f3472dce0710
5,280
extern crate chrono; extern crate git2; extern crate serde_json; use chrono::{NaiveDateTime, DateTime, FixedOffset}; use git2::{Object, Oid, Repository, Time}; use serde_json::{map::Map, value::Value}; use std::collections::HashMap; use std::env; use std::error::Error; use std::process; fn main() { let args: Vec<...
46.315789
149
0.575758
bbeb4fae562dee42975f31dc35eae48454d936a7
1,385
// Copyright (c) 2018-2022 The MobileCoin Foundation //! Watcher metrics comparing ledger height and block height use mc_common::HashMap; use mc_util_metrics::{IntGauge, OpMetrics}; use url::Url; lazy_static::lazy_static! { /// Create metric object for tracking watcher pub static ref COLLECTOR: OpMetrics = O...
28.265306
91
0.665704
90246a60ef8dbaa54f317542c6c809bd6e06a641
280
impl Solution { pub fn largest_perimeter(mut a: Vec<i32>) -> i32 { a.sort_by(|a, b| b.cmp(a)); for i in 0..(a.len() - 2) { if a[i] < a[i + 1] + a[i + 2] { return a[i] + a[i + 1] + a[i + 2]; } } 0 } }
23.333333
54
0.353571
ef17b458361709b75f0637fd1c76b6eca82eb67b
700
use crate::registry_interface::ManifestReader; use rocket::http::Header; use rocket::request::Request; use rocket::response::{self, Responder, Response}; impl<'r> Responder<'r, 'static> for ManifestReader { fn respond_to(self, _: &Request) -> response::Result<'static> { let ct = Header::new("Content-Type",...
36.842105
85
0.665714
08a2c50a83c03f1d19ba7aa88f840fb36f820952
3,350
#![allow(dead_code)] use std::{any::TypeId, cmp, fmt, hash}; use crate::{ cache::load_from_source, entry::{CacheEntry, CacheEntryInner}, source::Source, utils, Asset, Error, SharedString, }; pub(crate) trait AnyAsset: Send + Sync + 'static { fn reload(self: Box<Self>, entry: CacheEntryInner); ...
24.275362
99
0.584179
5b1c588208b4ecdfbea2efe0b10b75accc5dc43a
229,335
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive( std::clone::Clone, std::cmp::Eq, std::cmp::Ord, std::cmp::PartialEq, std::cmp::PartialOrd, std::fmt::Debug, std::hash::Hash, )...
40.454225
148
0.609305
0afd6b1756870bb7e4bcc291d59659cc997793f9
17,746
use std::borrow::Cow; use std::cmp; use std::cmp::Ordering::{self, Less, Greater, Equal}; use std::iter::repeat; use std::mem; use traits; use traits::{Zero, One}; use biguint::BigUint; use bigint::Sign; use bigint::Sign::{Minus, NoSign, Plus}; #[allow(non_snake_case)] pub mod big_digit { /// A `BigDigit` is a `...
30.231687
99
0.514989
e8df3ee96c9903286192a8ece42055cf0bb80857
9,344
// Non-camel case types are used for Stomp Protocol version enum variants #![macro_use] #![allow(non_camel_case_types)] use std::slice::Iter; use unicode_segmentation::UnicodeSegmentation; // Ideally this would be a simple typedef. However: // See Rust bug #11047: https://github.com/mozilla/rust/issues/11047 // Cann...
26.470255
100
0.539277
f864df31fa3093c7aea2766fd03905b467e038ee
2,333
/* * Copyright (C) 2019-2021 TON Labs. All Rights Reserved. * * Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use * this file except in compliance with the License. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an ...
27.77381
81
0.633948
f4e7147e97e61b2367bda0ba83df2f7c0235706a
5,607
use std::{fs::File, path::PathBuf}; use kagamijxl::{decode_memory, Decoder}; use libjxl_sys::JXL_ORIENT_IDENTITY; const MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR"); fn sample_image_path() -> PathBuf { // Resolve path manually or it will fail when running each test PathBuf::from(MANIFEST_DIR).join("tests/...
26.956731
86
0.661138
90b3733821622a9f249d6bb9402325dd51e7fcef
30,203
use std::collections::BTreeMap; use std::convert::TryFrom; use std::ffi::OsStr; use std::fmt; use std::path::PathBuf; use std::str::FromStr; use rustc_data_structures::fx::FxHashMap; use rustc_session::config::{ self, parse_crate_types_from_list, parse_externs, parse_target_triple, CrateType, }; use rustc_session:...
40.163564
170
0.585372
abe22c0a70018e04660bed0f8d9b02db9b6964df
2,474
use super::conn::Connection; use r2d2::{ManageConnection, Pool, PooledConnection}; use crate::{OrientError, OrientResult}; use std::net::SocketAddr; use std::sync::Arc; pub type SyncConnection = PooledConnection<ServerConnectionManager>; pub struct Cluster { servers: Vec<Arc<Server>>, } impl Cluster { pub(...
24.254902
96
0.604285
185371875acbd84205f3de615a7305f27fc2e3d9
580
use bebop::{bebop, Bebop}; bebop!("tests/a.bop"); #[test] fn media_message() { let data = MediaMessage { codec: Some(VideoCodec::H264), data: Some(VideoData { time: 1.0, width: 100, height: 300, fragment: vec![1, 2, 3], }), }; let by...
21.481481
57
0.505172
1823f4efa60666cfa5a91704cad3b0a0df72783a
246
pub mod config; pub mod dict_data; pub mod dict_type; pub mod gen_config_template; pub mod gen_table; pub mod gen_table_column; pub mod login_log; pub mod menu; pub mod middleware; pub mod oper_log; pub mod role; pub mod user; pub mod user_role;
17.571429
28
0.788618
281ff6bcdac38e055e40bb1152677abdc895adbd
133
#![deny(missing_debug_implementations, missing_docs)] // kcov-ignore //! Logic to control dispatcher frame rate. pub mod strategy;
22.166667
68
0.766917
62f86ac8e2bc97c4aabc798af2c61ce63d08e6b7
3,253
use parity_codec::Encode; use support::{decl_storage, decl_module, StorageValue, StorageMap, dispatch::Result, ensure, decl_event}; use system::ensure_signed; use runtime_primitives::traits::{As, Hash}; #[derive(Encode, Decode, Default, Clone, PartialEq)] pub struct Kitty<Hash, Balance> { id: Hash, dna: Ha...
31.892157
100
0.607132
79ac22efccae4f51d32a672d907e89cf2a37c42e
3,742
extern crate clap; extern crate serde_json; extern crate jmespath; use std::rc::Rc; use std::io::prelude::*; use std::io; use std::fs::File; use std::process::exit; use clap::{Arg, App}; use jmespath::Rcvar; use jmespath::{Variable, compile}; macro_rules! die( ($msg:expr) => ( match writeln!(&mut ::std::...
30.92562
95
0.519241
03180946b8d60c91d963f913cdceeae6de07687f
838
use colored::Colorize; use std::fmt; pub enum Response<T: fmt::Display> { Wrong(T), Weird(T), Note(T), } use self::Response::*; #[macro_export] macro_rules! response { ( $( $r:expr ),+ ) => {{ $( print!("{}", $r); )* println!(); }}; } impl<T: fmt::Display> fmt::Display for Respon...
22.052632
77
0.49642
75125c12085a68166d253f08d030f1762187beb3
24,644
#[doc = r" Value read from the register"] pub struct R { bits: u32, } #[doc = r" Value to write to the register"] pub struct W { bits: u32, } impl super::C1SC { #[doc = r" Modifies the contents of the register"] #[inline] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut ...
26.133616
149
0.501583
21a6d1712d0b36c781022682e68b8a7c4171e88b
12,384
// Copyright 2022 Cargill Incorporated // // 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 agre...
39.43949
97
0.50541
ddd0bc306101fff1f5c1b3f1e0ca38e63838800e
1,176
use std::prelude::v1::*; use { super::{error::ValueError, Value}, crate::{ executor::GroupKey, result::{Error, Result}, }, std::convert::TryInto, }; impl TryInto<GroupKey> for Value { type Error = Error; fn try_into(self) -> Result<GroupKey> { use Value::*; ma...
28
86
0.526361
b9afc2311a299f95d8e93791b5ee3e00c8933fda
32,206
//! A library for generating a message from a sequence of instructions use crate::sanitize::{Sanitize, SanitizeError}; use crate::serialize_utils::{ append_slice, append_u16, append_u8, read_pubkey, read_slice, read_u16, read_u8, }; use crate::{ hash::Hash, instruction::{AccountMeta, CompiledInstruction, I...
35.430143
100
0.572254
f97d499efd353d5f36f89c9f2fcfdc0828406850
13,146
use std::borrow::Cow; use chrono::{ DateTime, Utc, }; use derive_into_owned::IntoOwned; use super::{ EventData, UTC_TIME_FORMAT, }; use crate::{ error::{ Error, Result, }, util, }; /// The process creation event provides extended information about a newly created process. ...
41.866242
175
0.59927
29d7f2629a8bb2d2ed7ea19d2debb723f64b4090
16,253
//! A Parser for Proguard Mapping Files. //! //! The mapping file format is described //! [here](https://www.guardsquare.com/en/products/proguard/manual/retrace). use std::fmt; use std::str; #[cfg(feature = "uuid")] use uuid_::Uuid; /// Error when parsing a proguard mapping line. /// /// Since the mapping parses pro...
30.210037
174
0.530487
3a653e1c5e5a9a7dcebd0410e0260a09a8338ef1
6,516
use crate::actions::Action; use crate::Role; use mcts::{statistics, SearchSettings}; use rand::Rng; use search_graph; use std::{cmp, mem}; #[derive(Clone, Debug)] pub struct Game {} impl statistics::two_player::PlayerMapping for Role { fn player_one() -> Self { Role::Dwarf } fn player_two() -> Self { Ro...
29.484163
97
0.626151
9be8714933f49c1175601a3874f78ec02e8cbd92
119
#![feature(test)] extern crate test; use test::Bencher; #[bench] fn example2(b: &mut Bencher) { b.iter(|| 1); }
10.818182
30
0.605042
d5142dbe8a3976ae5d698ca536fd9ced69091a9f
9,480
// Copyright 2016 Joe Wilm, The Alacritty Project Contributors // // 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 b...
34.223827
100
0.651793
222788ec6dbc8fa8166c86fe5734a92db9fac6c8
1,362
// This node creates an end-to-end encrypted secure channel over two tcp transport hops. // It then routes a message, to a worker on a different node, through this encrypted channel. use ockam::{ route, Address, Context, Entity, NoOpTrustPolicy, Result, SecureChannels, TcpTransport, TCP, }; #[ockam::node] async f...
38.914286
96
0.657856
23e96110c066568dd1e32f341f3501d15a5bf7f2
12,598
// 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 ...
29.642353
83
0.462613
56acc4d92c6318c5bb3cc78e6d48c22c93f50e0a
11,966
mod auth; mod error; mod helpers; mod responders; mod routes; mod snapshot; mod state; #[macro_use] extern crate tracing; use std::net::SocketAddr; use std::path::{Path, PathBuf}; use std::time::Duration; use anyhow::{anyhow, Context, Result}; use bincode::Options; use clap::Parser; use engine::structures::{IndexDec...
30.141058
97
0.607053
61e0677ca8c9bc29df5f02e92ededc7b0d173dbc
5,456
use serde::de::DeserializeOwned; use serde_json::from_reader; use std::fs::File; use std::path::PathBuf; use std::process::{Command, Output}; use std::str::from_utf8; use tempfile::TempDir; use types::{ChainSpec, Config, EthSpec}; pub trait CommandLineTestExec { type Config: DeserializeOwned; fn cmd_mut(&mut ...
36.864865
136
0.608138
f5e93c3971fb0fb3777ce7e18c46e5f88c8434c2
35,080
// Copyright 2020 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any late...
27.470634
129
0.684692
2fe929dd42b3b0b7a3357d57d0037bdd45f77d8e
585
//! Available methods. use hyper::Method; use serde::{de::DeserializeOwned, Serialize}; pub mod builders; mod close; mod forward_message; mod get_chat; mod get_me; mod get_updates; mod log_out; mod send_chat_action; mod send_dice; mod send_message; pub use close::*; pub use forward_message::*; pub use get_chat::*; p...
18.28125
45
0.726496
e4fcbb117a5057c0dd55eb757713496102a08bad
668
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
26.72
68
0.726048
8760345409c8e9dfa1d1bf6ef6e1c556fa298fc7
304
// error-pattern: pointer at offset 32 is out-of-bounds fn main() { let x = Box::into_raw(Box::new(0u32)); let x = x.wrapping_offset(8); // ok, this has no inbounds tag let _x = unsafe { x.offset(0) }; // UB despite offset 0, the pointer is not inbounds of the only object it can point to }
38
123
0.661184
64b63c01eafe3aa201949e707c8d35a1f1c31f87
1,502
use std::collections::HashSet; use std::hash::Hash; use std::time::Instant; use unique_id::random::RandomGenerator; use unique_id::sequence::SequenceGenerator; use unique_id::string::StringGenerator; use unique_id::{Generator, GeneratorWithInvalid}; #[test] fn test_random_uniqueness() { let generator = RandomGener...
28.339623
81
0.667776
efa8e29c4946af94538a55d1ef9c735abe7f80df
9,149
use std::{os::unix::io::RawFd, sync::Arc}; use adw::prelude::*; use ashpd::{ desktop::{ screencast::{CursorMode, PersistMode, ScreenCastProxy, SourceType, Stream}, SessionProxy, }, enumflags2::BitFlags, zbus, WindowIdentifier, }; use futures::lock::Mutex; use gtk::{ glib::{self, clo...
35.599222
110
0.565854
f83e30bb5f555ab7a5757a847a59d51a64d7fc68
745
use crate::object::*; use std::os::raw::c_int; #[cfg_attr(windows, link(name = "pythonXY"))] extern "C" { pub static mut PySeqIter_Type: PyTypeObject; pub static mut PyCallIter_Type: PyTypeObject; } #[inline] pub unsafe fn PySeqIter_Check(op: *mut PyObject) -> c_int { (Py_TYPE(op) == &mut PySeqIter_Type) ...
25.689655
85
0.67651
e2640d195a0524cb198ccfd5f1bb8b9e5c7899a1
2,320
use image::{GenericImage, ImageBuffer, Pixel}; use crate::definitions::{Clamp, Image}; use conv::ValueInto; use std::f32; use std::i32; use crate::pixelops::weighted_sum; use rusttype::{Font, Scale, point, PositionedGlyph}; /// Draws colored text on an image in place. `scale` is augmented font scaling on both the x ...
32.676056
195
0.5875
d7fefc2ef161fb06942ead6a31b9bfc267861ba1
9,734
// Copyright 2018 sqlparser-rs contributors. All rights reserved. // Copyright Materialize, Inc. All rights reserved. // // This file is derived from the sqlparser-rs project, available at // https://github.com/andygrove/sqlparser-rs. It was incorporated // directly into Materialize on December 21, 2019. // // Licensed...
17.444444
94
0.588145
7aa5e3513eb2624916bdad99fded6ce0aa26ac60
304,950
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. #[derive(Debug)] pub(crate) struct Handle< C = aws_smithy_client::erase::DynConnector, M = aws_hyper::AwsMiddleware, R = aws_smithy_client::retry::Standard, > { client: aws_smithy_client::Client<C, M, R>, conf: crate::C...
46.937048
251
0.604024
79f2b72b577cf0e3f43ea6d2a4fbb28036f77ac5
2,332
#![no_std] extern crate task; #[macro_use] extern crate terminal_print; #[macro_use] extern crate alloc; // #[macro_use] extern crate log; extern crate fs_node; extern crate getopts; extern crate path; use alloc::vec::Vec; use alloc::string::String; use alloc::string::ToString; use fs_node::{FileOrDir, DirRef}; use g...
26.202247
130
0.580617
386bc3bd15478700484e419e753ce25fe335f822
8,207
use crate::model::{OnnxOpRegister, ParsingContext}; use crate::pb::NodeProto; use tract_core::internal::*; pub fn register_all_ops(reg: &mut OnnxOpRegister) { reg.insert("QuantizeLinear", quantize_linear); reg.insert("DequantizeLinear", dequantize_linear); } fn quantize_linear( _ctx: &ParsingContext, ...
34.338912
100
0.550018
767537027e76f92ad2a9066ac6a1b9c63e1cb74d
5,124
#![crate_name = "msp432"] #![crate_type = "rlib"] #![feature(asm, const_fn)] #![no_std] use cortexm4::{ generic_isr, hard_fault_handler, svc_handler, systick_handler, unhandled_interrupt, }; pub mod adc; pub mod chip; pub mod cs; pub mod dma; pub mod flctl; pub mod gpio; pub mod nvic; pub mod pcm; pub mod ref_mod...
35.337931
87
0.619048
bfc7e838dc2cfae1eb6f1b8905c6718c8e321a7b
77
pub mod alert; #[cfg(feature = "engine")] pub use alert::{Alert, AlertOpts};
19.25
34
0.675325
f5deb4b925c79881f3c8f3a67eb26ee31f87583a
22,805
use command_executor::{Command, CommandContext, CommandMetadata, CommandParams, CommandGroup, CommandGroupMetadata}; use commands::*; use utils::table::print_list_table; use libindy::ErrorCode; use libindy::did::Did; use libindy::ledger::Ledger; use std::fs::File; use serde_json::Value as JSONValue; use serde_json::...
37.324059
176
0.528437
716c0c328c8172602ed95b728a1e52a21a36fa83
2,120
// Copyright 2021 Datafuse Labs. // // 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 ...
33.650794
106
0.638679
bf3452f07327115466beb0f64d6da80c22ab7c7c
16,410
//! Network upgrade consensus parameters for Zcash. use NetworkUpgrade::*; use crate::block; use crate::parameters::{Network, Network::*}; use std::collections::{BTreeMap, HashMap}; use std::ops::Bound::*; use chrono::{DateTime, Duration, Utc}; #[cfg(any(test, feature = "proptest-impl"))] use proptest_derive::Arbi...
39.071429
108
0.661121
bf62986c31d7b33fe8c5d80af8acf3e8bd01e4ec
13,191
// In this file we define the PackedFile type RigidModel for decoding and encoding it. // This is the type used by 3D model files of units and buildings. Both are different, so we need to // take the type in count while processing them. extern crate failure; use common::coding_helpers; use self::failure::Error; /// ...
42.278846
149
0.657115
e68fab59073b40cf328fbd060afafd529c778773
1,976
use crate::boards::CoordIdxConverter; use regex::Regex; use std::fmt; use std::fmt::{Debug, Formatter}; pub struct ChessBoard { converter: Box<dyn CoordIdxConverter>, pub rows: usize, pub cols: usize, row_char_count: usize, col_char_count: usize, regex: Regex, } impl Debug for ChessBoard { ...
28.637681
103
0.529352
9b1625786294ad3758e27a18e2822523618729cf
1,309
#![cfg_attr( feature = "dev", allow(dead_code, unused_variables, unused_imports, unreachable_code) )] #![cfg_attr(feature = "ci", deny(warnings))] #![deny(clippy::all)] use path::PathBuf; use scriptkeeper::{context::Context, run_scriptkeeper, ExitCode, R}; use std::*; pub fn test_run_from_directory(directory:...
31.166667
88
0.622613
019603b3622c2d3aca50aaa057541d95b78e554c
3,741
use std::sync::Arc; use waithandle::{EventWaitHandle, WaitHandle}; use crate::builds::{Build, BuildBuilder, BuildProvider, BuildStatus}; use crate::config::AzureDevOpsConfiguration; use crate::providers::collectors::{Collector, CollectorInfo}; use crate::utils::{date, DuckResult}; use self::client::*; mod client; m...
32.815789
83
0.483828
0a683fcdd8cdd931df7becedb09ee6c919cd829b
4,300
use std::sync::Arc; use std::time::Duration; use anyhow::Result; use futures::stream::StreamExt; use maplit::btreeset; use openraft::Config; use openraft::State; use tokio::time::sleep; use crate::fixtures::RaftRouter; /// Dynamic membership test. /// /// What does this test do? /// /// - bring a single-node cluster...
36.752137
109
0.666977
482a0f3d677af0d2fe18877c2cccc4301b0ed1f3
5,672
//! internal ghost actor file wrapper use crate::*; ghost_actor::ghost_chan! { /// chan wrapper for file access pub(crate) chan EntryStoreFile<LairError> { /// init and load up the "unlock" entry if it exists fn init_load_unlock() -> Option<Vec<u8>>; /// write the unlock entry to the ...
27.668293
78
0.573166
096716ccb37a595c117ee36431a2e74c9f8d9c40
4,169
#![crate_name = "uu_tr"] #![feature(io)] /* * This file is part of the uutils coreutils package. * * (c) Michael Gehring <mg@ebfe.org> * (c) kwantam <kwantam@gmail.com> * 20150428 created `expand` module to eliminate most allocs during setup * * For the full copyright and license information, please view th...
25.266667
77
0.524826
f419699b06df23f4a791cd7889c8ddaef55cd51a
2,089
use http::header::ACCEPT; use mime::Mime; use super::QualityItem; header! { /// `Accept` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-5.3.2) /// /// The `Accept` header field can be used by user agents to specify /// response media types that are acceptable. Accept header f...
32.640625
95
0.509335
48a53a62679d51fa7c468b48e5cf67681e2f0575
5,524
#[doc = "Register `rf_singen_3` reader"] pub struct R(crate::R<RF_SINGEN_3_SPEC>); impl core::ops::Deref for R { type Target = crate::R<RF_SINGEN_3_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<RF_SINGEN_3_SPEC>> for R { #[inline(always)] fn f...
31.565714
404
0.61966
23dc8e8f8933dc35380cb776dfcd62d473fbbf4c
2,525
use optarg2chain::*; #[optarg_fn(JoinStringBuilder, exec)] fn join_strings( mut a: String, #[optarg_default] b: String, #[optarg("ccc".to_owned())] c: String, ) -> String { a.push_str(&b); a.push_str(&c); a } #[test] fn join_strings_test() { assert_eq!(join_strings("aaa".to_owned()).exec()...
21.767241
71
0.560396
fc52f46a5141a3fdae1b8596817c1420bf8da406
31,179
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
41.242063
99
0.609737
03df51ebf2c3ee4a9b97f501221974fb7129ca2e
1,363
use serde_json::Number; #[derive(Serialize, Deserialize, Debug)] pub struct GroupResponse { pub id: Number, pub name: String, } #[derive(Serialize, Deserialize, Debug)] pub struct ProjectResponse { pub id: Number, pub name: String, pub ssh_url_to_repo: String, pub http_url_to_repo: String, } ...
21.296875
40
0.683786
0382a9beaf54cbafe57de408d0bbc833a63ce6b5
2,670
// Copyright 2020 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
80
0.646067
f8e4fd20ead43f91733ac2d7e687a6cfe2860ebf
3,388
use { lewp::{ config::{ModuleConfig, PageConfig}, dom::{NodeCreator, Nodes}, module::{Module, Modules, RuntimeInformation}, page::Page, Charset, LanguageTag, LewpError, }, std::rc::Rc, }; struct HelloWorld { pub config: ModuleConfig, head_tags...
26.263566
404
0.589433
f95df2caef9da54070a7bc64f2f4625db329620b
1,609
//! Temperature sensor interface. use crate::pac::TEMP; use fixed::types::I30F2; use void::Void; /// Integrated temperature sensor. pub struct Temp(TEMP); impl Temp { /// Creates a new `Temp`, taking ownership of the temperature sensor's register block. pub fn new(raw: TEMP) -> Self { Temp(raw) }...
27.741379
90
0.584214
5d34b784c3c0d5d652c91833be1e7d2ddada779a
30,486
//! Implements module serialization. //! //! This module implements the serialization format for `wasmtime::Module`. //! This includes both the binary format of the final artifact as well as //! validation on ingestion of artifacts. //! //! There are two main pieces of data associated with a binary artifact: //! //! 1....
34.06257
152
0.564489
233a7b8fcf8365007003f245ee9ff6ddb9a4ae02
2,266
fn print(count: &mut usize, id: usize, layout: &layout::tree::LayoutR) { *count += 1; debug_println!("result: {:?} {:?} {:?}", *count, id, layout); } pub fn compute() { let mut layout_tree = layout::tree::LayoutTree::default(); layout_tree.insert( 1, 0, 0, layou...
31.472222
73
0.469109
e8c3dc49f39c21ed5d494e150f6d618094030f02
1,644
// Copyright 2018-2020 Cargill Incorporated // // 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...
37.363636
80
0.680049
29ea47603308f57491ae152a8be12f440384d3c0
14,191
use log::*; /// Cluster independent integration tests /// /// All tests must start from an entry point and a funding keypair and /// discover the rest of the network. use rand::{thread_rng, Rng}; use rayon::prelude::*; use solana_client::thin_client::create_client; use solana_core::validator::ValidatorExit; use solana_...
35.389027
100
0.603833
90f8060f9a5654fe2a008ae7719b8fdbe5d0da34
8,148
// This file is part of Substrate. // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 // // ht...
31.952941
106
0.698085
1ef782f890f46411570ba513eefb6d5c442debbc
3,309
#[doc = "Register `DSTS` reader"] pub struct R(crate::R<DSTS_SPEC>); impl core::ops::Deref for R { type Target = crate::R<DSTS_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<DSTS_SPEC>> for R { #[inline(always)] fn from(reader: crate::R<DSTS_SP...
29.026316
250
0.600484
2128167b252ed5b40495542890ea4162db468ccf
13,173
use data_sep::*; use molecule::Molecule; use reaction::{ElemReaction, ReactionCompound}; use ion::Ion; use trait_element::Element; use trait_properties::Properties; use trait_reaction::Reaction; use types::*; use reaction::ReactionSide; use redox::RedoxReaction; use std::hash::{Hash, Hasher}; #[derive(Debug, Clone)]...
27.160825
108
0.528505
d971664e2de9e89f34c975fb44cb6f24fd339bd1
849
use readers::prelude::Value; use std::io::{BufWriter, Write}; pub mod int_value_fmt; pub mod float_value_fmt; pub mod str_value_fmt; pub mod unspecified_value_fmt; pub use self::int_value_fmt::*; pub use self::float_value_fmt::*; pub use self::str_value_fmt::*; pub use self::unspecified_value_fmt::*; /// The value f...
36.913043
102
0.740872
72d6daedddf0a8b29092bbfe1067c0c0e78b02bb
1,638
/* * NHL API * * Documenting the publicly accessible portions of the NHL API. * * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech */ use std::rc::Rc; use std::borrow::Borrow; use hyper; use serde_json; use futures::Future; use super::{Error, configuration}; use su...
31.5
118
0.674603
4836a0cf547ff7dc118cdab4608771e5946936a5
254
#[tokio::test] async fn noarg() { let script = redis_lua::lua!( return 1 + 3 + 10; ); let mut cli = redis::Client::open("redis://127.0.0.1").unwrap(); let res: usize = script.invoke(&mut cli).unwrap(); assert_eq!(res, 14); }
23.090909
68
0.559055
e27c89cda6029a0d2aad9e0c49afe33c250f2978
1,473
use proc_macro::{TokenStream, TokenTree}; pub fn html(input: TokenStream) -> TokenStream { let mut tokens = input.into_iter(); let html = if let Some(TokenTree::Literal(literal)) = tokens.next() { let repr = literal.to_string(); let repr = repr.trim(); if repr.starts_with('"') || repr...
32.021739
87
0.551935
9cecef6ac5515ef9a882e18eed94406a61ecb9e7
1,216
use ksz8863::smi::{self, Smi}; // Run with `cargo test -- --nocapture` #[test] fn smi_map_default() { let map = smi::Map::default(); for &addr in smi::Address::ALL { println!("{:#?}", map[addr]); } } #[test] fn smi_api() { // Rather than a `Map`, we would normally use a real SMI interface, how...
27.636364
99
0.592105
5b25024a554d77e43f4d2e1b21b3a8251449e165
9,488
// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. // Copyright (C) 2020 Red Hat, Inc. All rights reserved. // SPDX-License-Identifier: Apache-2.0 //! A wrapper over an `ArcSwap<GuestMemory>` struct to support RCU-style mutability. //! //! With the `backend-atomic` feature enabled, simply replacing `G...
38.104418
92
0.620363
483b1d1696178aa8b58b9446aee2b7335e213f7e
1,861
// Copyright 2018 Google LLC // // 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 ...
29.078125
78
0.61741
03c11429e0220bc2cbe73f45ecd9dab482f9894f
5,583
#[doc = "Register `EVENTS_RATEBOOST` reader"] pub struct R(crate::R<EVENTS_RATEBOOST_SPEC>); impl core::ops::Deref for R { type Target = crate::R<EVENTS_RATEBOOST_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<EVENTS_RATEBOOST_SPEC>> for R { #[inli...
34.677019
483
0.638904
d93c9bafaef27c36c205a5e933f106810aac50f1
627
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
24.115385
68
0.6874
dba43bea000e702ba6c08338ec113b512de25195
15,596
use crate::PrintFmt; use crate::{resolve, resolve_frame, trace, BacktraceFmt, Symbol, SymbolName}; use std::ffi::c_void; use std::fmt; use std::path::{Path, PathBuf}; use std::prelude::v1::*; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; /// Representation of an owned and self-contained backtrace. //...
32.424116
88
0.576494
23b907791c86f6c25cca766648ba2de017a8581c
1,211
use std::io; use std::sync::Arc; use async_trait::async_trait; use log::*; use crate::{ proxy::{ OutboundConnect, OutboundDatagram, OutboundHandler, OutboundTransport, UdpOutboundHandler, DatagramTransportType, }, session::Session, }; pub struct Handler { pub actors: Vec<Arc<dyn Outbo...
25.765957
98
0.574732
11681dcda2b274bd21e1dc67e50d07e2d09b32bb
1,801
use super::{create_collector, Pages, Pagination}; use crate::embeds::CommandCounterEmbed; use chrono::{DateTime, Utc}; use failure::Error; use serenity::{ async_trait, client::Context, collector::ReactionCollector, model::{channel::Message, id::UserId}, }; pub struct CommandCountPagination { msg:...
25.013889
70
0.564131
7543dd678d032fdd9a3f730ea0845ae4708a52e4
16,259
use rustc::ty::{self, Ty, TypeAndMut}; use rustc::ty::layout::{self, TyLayout, Size}; use syntax::ast::{FloatTy, IntTy, UintTy}; use rustc_apfloat::ieee::{Single, Double}; use rustc::mir::interpret::{ Scalar, EvalResult, Pointer, PointerArithmetic, EvalErrorKind, truncate }; use rustc::mir::CastKind; use rustc_apf...
41.058081
99
0.445907
08edc44fa7ec9e804453421d5ba86a4f3375d0ea
632
use std::error::Error; use error::Error as AppscrapsError; use error::ErrorKind as AppscrapsErrorKind; use error::Result as AppscrapsResult; pub trait WrapError { fn wrap_error_to_err<TResult>(self) -> AppscrapsResult<TResult>; fn wrap_error_to_error(self) -> AppscrapsError; } impl <TError> WrapError for TEr...
27.478261
69
0.704114
de0b89f46ba3fbd8a643a2009af9dc28f08da45e
1,464
// revisions: mir thir // [thir]compile-flags: -Z thir-unsafeck // only-x86_64 #![feature(target_feature_11)] #[target_feature(enable = "sse2")] const fn sse2() {} #[target_feature(enable = "avx")] #[target_feature(enable = "bmi2")] fn avx_bmi2() {} struct Quux; impl Quux { #[target_feature(enable = "avx")] ...
29.28
86
0.618169
1eb7c8039ddec7977477191d9cc8d4a790a5f1c4
1,098
#[doc = "Reader of register US_LONPR"] pub type R = crate::R<u32, super::US_LONPR>; #[doc = "Writer for register US_LONPR"] pub type W = crate::W<u32, super::US_LONPR>; #[doc = "Register US_LONPR `reset()`'s with value 0"] impl crate::ResetValue for super::US_LONPR { type Type = u32; #[inline(always)] fn re...
26.780488
74
0.57286
d65860b9cf2f074780b2caeec0e93026780fe62c
3,085
#[doc = "Register `US_LINIR` reader"] pub struct R(crate::R<US_LINIR_SPEC>); impl core::ops::Deref for R { type Target = crate::R<US_LINIR_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<US_LINIR_SPEC>> for R { #[inline(always)] fn from(reader: ...
29.663462
412
0.60389
abea32802f5cf2222a73593ef052b2283e768eaf
5,706
#[doc = "Reader of register PSELP"] pub type R = crate::R<u32, super::PSELP>; #[doc = "Writer for register PSELP"] pub type W = crate::W<u32, super::PSELP>; #[doc = "Register PSELP `reset()`'s with value 0"] impl crate::ResetValue for super::PSELP { type Type = u32; #[inline(always)] fn reset_value() -> Sel...
28.964467
70
0.55205
50ec592f5f389236b3e3e1baef62c6019faacc0b
938
/// Fallback mode after successful packet transmission or packet reception. /// /// Argument of [`set_tx_rx_fallback_mode`]. /// /// [`set_tx_rx_fallback_mode`]: crate::subghz::SubGhz::set_tx_rx_fallback_mode. #[derive(Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[repr(u8)]...
24.684211
80
0.621535
f4ccbb5cecd29575e1aaea6908036115aab6a92e
2,303
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ account_address::AccountAddress, chain_id::ChainId, transaction::{RawTransaction, SignedTransaction, TransactionPayload}, }; use anyhow::Result; // use chrono::Utc; use diem_crypto::{ed25519::*, test_utils::KeyP...
28.085366
80
0.685193
ff52b0e95699ce7180375ab5c7cad0b58ec51c27
685
use crate::guild::Guild; use discord_types::Message; use std::future::Future; pub trait CanEdit<'a> { fn edit(&'a self, guild: &'a Guild) -> EditBuilder<'a>; } impl<'a> CanEdit<'a> for Message { fn edit(&'a self, guild: &'a Guild) -> EditBuilder<'a> { EditBuilder::new(self, guild) } } pub struct EditBuilder<'a>...
19.571429
65
0.616058
e556d22992f6b6571386b0331d4889b81a817a70
4,361
use lock_api::{ RawMutex, RawRwLock, RawRwLockDowngrade, RawRwLockRecursive, RawRwLockUpgrade, RawRwLockUpgradeDowngrade, }; use std::cell::Cell; pub struct RawCellMutex { locked: Cell<bool>, } unsafe impl RawMutex for RawCellMutex { const INIT: Self = RawCellMutex { locked: Cell::new(false), ...
21.805
82
0.553084
6142892ea6f5e7848e0a2bf944445535cc9dcdc8
15,324
//! A crate of fundamentals for audio PCM DSP. //! //! - Use the [**Sample** trait](./trait.Sample.html) to remain generic across bit-depth. //! - Use the [**Frame** trait](./frame/trait.Frame.html) to remain generic over channel layout. //! - Use the [**Signal** trait](./signal/trait.Signal.html) for working with **It...
31.858628
114
0.576155
b9e4758b857fac1758832496b5ceac9c9299c307
415
use snafu::prelude::*; #[derive(Debug, Snafu)] enum InnerError { #[snafu(display("inner error"))] AnExample, } #[derive(Debug, Snafu)] enum Error { NoDisplay { source: InnerError }, } #[test] fn default_error_display() { let err: Error = AnExampleSnafu .fail::<()>() .context(NoDisplay...
18.863636
62
0.60241
16ae9605ec1c6d6aef9a0ba98c4fa48dc5c1aaf7
36,800
// Copyright 2022 pyke.io // 2019-2021 Tauri Programme within The Commons Conservancy // [https://tauri.studio/] // // 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...
38.134715
142
0.703668
0a3767186960f21449da1a0aa3429435c4217dd7
5,021
use crate::{error::Convert, object::Object, schema::Any}; use serde::{ de::{DeserializeSeed, Deserializer, EnumAccess, Error, MapAccess, SeqAccess, Visitor}, Deserialize, }; use std::{borrow::Cow, fmt}; pub struct AnyVisitor; impl<'de> Visitor<'de> for AnyVisitor { type Value = Object; fn expecting(&...
21.549356
90
0.523402
e256bae37ae2d0a1ea9d69585ee7dcb48583af37
7,814
use std::collections::HashMap; use std::path::{/*Path, */PathBuf}; use serde::{Deserialize, Serialize}; mod config; use config::{ProjectSettings}; mod camera; use edsdk::wrap; //use edsdk::types; #[derive(Serialize, Deserialize, Debug)] struct RecieveInfo{ id: i32, name: String, value: String,...
38.492611
143
0.525979
d7a44877d1a22b6af3a7211e25b03312d8fb36bc
1,426
// Copyright 2017 Zachary Bush. // // 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 // except according t...
29.102041
87
0.693548