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
76e9a812614757a71964f913bf5139aa3dfb29ca
1,948
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors // SPDX-License-Identifier: MIT use std::fmt; use getset::Getters; use serde::{Deserialize, Serialize}; use tezos_encoding::{enc::BinWriter, encoding::HasEncoding, generator::Generated, nom::NomReader}; use super::limits::CHAIN_NAME_MAX_LENGTH; ...
29.515152
98
0.658624
fe112cc3887b11f53d5afac2da6569958ebf9976
20,706
use linked_hash_map::LinkedHashMap; use parser::*; use scanner::{Marker, ScanError, TScalarStyle, TokenType}; use std::collections::BTreeMap; use std::f64; use std::i64; use std::mem; use std::ops::Index; use std::string; use std::vec; /// A YAML node is stored as this `Yaml` enumeration, which provides an easy way to...
27.981081
93
0.495364
bb00fc5d2d5d5bf3e5f206b2db4963ca9bc5bc41
4,863
use super::{Contract, ContractVariable, Symbol}; use output::Output; use parser::ast; use resolver::cfg::{ControlFlowGraph, Instr, Storage, Vartable}; use resolver::expression::{cast, expression, Expression}; use resolver::ContractVariableType; pub fn contract_variables( def: &ast::ContractDefinition, ns: &mut...
27.788571
91
0.481596
08b58c523b5e3c618653d42b16b00445b66de38f
23,758
use anyhow::Result; use bevy_asset::{ AssetIoError, AssetLoader, AssetPath, BoxedFuture, Handle, LoadContext, LoadedAsset, }; use bevy_core::Name; use bevy_ecs::world::World; use bevy_math::Mat4; use bevy_pbr::prelude::{PbrBundle, StandardMaterial}; use bevy_render::{ camera::{ Camera, CameraProjection,...
35.197037
100
0.54529
f7e3c73d5bc1ee8245aceeec055cc0667e01f36f
4,313
use crate::type_name::PrettyType; use crate::value::primitive::Primitive; use crate::value::{UntaggedValue, Value}; use nu_source::{DbgDocBldr, DebugDocBuilder, PrettyDebug}; impl PrettyDebug for &Value { /// Get a borrowed Value ready to be pretty-printed fn pretty(&self) -> DebugDocBuilder { PrettyDe...
40.688679
88
0.553443
11a027a13f7e317f442d5ae5c91332ebbcc01ac6
655
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
31.190476
68
0.723664
d7b32a8484e60074b848828ed978e3c4eb26aba0
1,555
#![allow(clippy::use_self)] extern crate clap; extern crate env_logger; extern crate ruma; use clap::{App, AppSettings, Arg, SubCommand}; use ruma::config::Config; use ruma::server::Server; fn main() { if let Err(error) = env_logger::try_init() { eprintln!("Failed to initialize logger: {}", error); ...
28.796296
81
0.507395
d92c0a2731fd7b7d8e9672d98a961dfcd71b5790
3,155
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. pub struct Config { pub(crate) make_token: Box<dyn crate::idempotency_token::MakeIdempotencyToken>, pub(crate) endpoint_resolver: ::std::sync::Arc<dyn aws_endpoint::ResolveAwsEndpoint>, pub(crate) region: Option<aws_types::regi...
38.47561
142
0.63233
29c4d3898da39b590718b4bc4d1a00bf80fed001
40,196
#![cfg(target_os = "windows")] use parking_lot::Mutex; use raw_window_handle::{RawWindowHandle, Win32Handle}; use std::{ cell::Cell, ffi::c_void, io, mem, panic, ptr, sync::{mpsc::channel, Arc}, }; use windows_sys::Win32::{ Foundation::{ HINSTANCE, HWND, LPARAM, OLE_E_WRONGCOMPOBJ, POINT, ...
35.352682
124
0.564708
eb77a39ecb3c1c5e34f7747fc5bfb2c402df87a0
4,534
//! //! # Delete Topic Request //! //! Delete topic request handler. Lookup topic in local metadata, grab its K8 context //! and send K8 a delete message. //! use dataplane::ErrorCode; use tracing::{debug, instrument, trace}; use std::io::Error; use dataplane::api::{RequestMessage, ResponseMessage}; use fluvio_sc_sche...
33.585185
89
0.595721
fb197d99de4a68543bf874f3f2d6e203c25b73e9
151
mod builder; pub mod http; pub mod middleware; pub use self::builder::NewServiceExt; #[doc(no_inline)] pub use tower_service::{NewService, Service};
16.777778
45
0.754967
e8f3c8124b682a35c77eb88313f106757bd0fc03
14,438
#![cfg_attr(not(feature = "std"), no_std)] use sp_std::{fmt::Debug, prelude::*}; use sp_runtime::{ RuntimeDebug, Percent, traits::{ Hash, AtLeast32BitUnsigned, Zero, // Saturating, CheckedSub, CheckedAdd, }, }; use frame_support::{ traits::{ Currency, ReservableCurrency, ExistenceRequirement::{KeepAlive},...
32.96347
122
0.691855
033ff8c6c67a9d62f873df8a7b4356e2aa5e1fee
36
/// Software key impl pub mod soft;
12
21
0.694444
1eb59889a8674111ef393566ef48a485bacf3801
2,662
#[derive(Copy, Clone, Debug, PartialEq)] pub struct PermutationElement<'a> { direction: bool, value: &'a str, } pub type PermutationElements<'a> = Vec<PermutationElement<'a>>; pub type PermutationElementRefs<'a> = Vec<&'a mut PermutationElement<'a>>; #[derive(Debug, PartialEq)] pub struct Permuter<'a> { current...
28.021053
87
0.613449
2f2bf0b72cde60b0254382941afc0e74bd73ce39
759
1 1.7830037230933333 0 2 1.7830037230933333 17 3 1.7830037230933333 49 4 1.7830037230933333 19 5 1.7830037230933333 51 6 0.45367267733333344 101 7 0.24822168499199995 107 8 0.2998809452444444 103 9 0.27078669279999995 87 10 0.35009989324800006 106 11 0.36153334124088893 110 12 0.5044219813333333 102 13 0.42289779804444...
24.483871
26
0.841897
ebb198b8179cf31413cbdc9d74e0e335d04d234d
634
//! The `std::ops` module. use crate::{ContextError, Module, Protocol, Range, Value}; /// Construct the `std::ops` module. pub fn module() -> Result<Module, ContextError> { let mut module = Module::with_crate_item("std", &["ops"]); module.ty::<Range>()?; module.inst_fn("contains_int", Range::contains_int)...
28.818182
62
0.662461
d7f78dca1fb5a7fd1ee5fa5896644cf2987cce36
38,741
use std::collections::hash_map::{Entry, HashMap}; use std::fs::File; use std::path::Path; use std::sync::{Arc, RwLock}; use std::{fs, thread}; use crossbeam_channel::{Receiver, Sender}; use heed::types::{Str, Unit}; use heed::{CompactionOption, Result as ZResult}; use log::debug; use meilisearch_schema::Schema; use c...
35.315406
391
0.558349
de8116be6fc593786aafcd80dfb6c0061fb60310
1,496
// This file is part of ucx. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/ucx/master/COPYRIGHT. No part of ucx, including this file, may be copied, modified, propagated, or distributed except according t...
37.4
364
0.766711
21477ddec3aaa493035b3461bc5029e29654eec4
445
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT // This test checks that Kani injects a reachability check for the assert_eq // macro. The test has an unreachable assert_eq statement which should be // reported as UNREACHABLE #[kani::proof] fn main() ...
29.666667
76
0.65618
0373175e25644f22badc4c1aa69aac23501f3873
9,560
#![doc = include_str!("../README.md")] #![cfg_attr(docsrs, feature(doc_cfg))] // Due to `schema_introspection` test. #![cfg_attr(test, recursion_limit = "256")] #![warn(missing_docs)] // Required for using `juniper_codegen` macros inside this crate to resolve // absolute `::juniper` path correctly, without errors. ext...
33.426573
98
0.677092
48f6e029ee95f8d6cb2fe4571301028499fd397a
365
fn main() { println!(r"cargo:rustc-link-search=./sysroot/opt/vc/lib"); println!(r"cargo:rustc-link-search=./sysroot/opt/vc/include"); println!(r"cargo:rustc-link-search=./sysroot/usr/lib"); println!(r"cargo:rustc-link-search=./sysroot/usr/include"); println!(r"cargo:rustc-link-lib=brcmEGL"); pri...
40.555556
66
0.682192
5d2924993ae1e7a8dbdeeac15ddb08c639ffe5e3
1,286
extern crate rand; extern crate ropey; use std::io::Cursor; use ropey::Rope; const TEXT: &str = include_str!("test_text.txt"); #[test] fn from_reader_01() { // Make a reader from our in-memory text let text_reader = Cursor::new(TEXT); let rope = Rope::from_reader(text_reader).unwrap(); assert_eq!(...
22.964286
68
0.643857
de3108878bf24ffdd017686450409fee4eef86ed
35,943
//! Instruction types #![allow(clippy::too_many_arguments)] use { crate::{ find_deposit_authority_program_address, find_stake_program_address, find_transient_stake_program_address, find_withdraw_authority_program_address, stake_program, state::{Fee, StakePool, ValidatorList}, ...
36.864615
148
0.649751
1a78f5065813ad750cceb6fbfbfdf571d18d74c0
93
pub mod view; pub mod design; pub mod system; pub mod document; pub mod find; pub mod index;
13.285714
17
0.741935
fc21412821445f70b708fe012cd982ac633ccea7
632
use proptest::arbitrary::any; use proptest::strategy::{BoxedStrategy, Strategy}; use liblumen_alloc::erts::term::prelude::Atom; use crate::test::strategy::term::NON_EXISTENT_ATOM_PREFIX; pub fn module() -> BoxedStrategy<Atom> { atom() } pub fn function() -> BoxedStrategy<Atom> { atom() } pub fn arity() -> ...
22.571429
67
0.636076
ac63a9aeabc8eacab7179d615fc98906692d6780
1,512
#![feature(map_first_last)] mod bigint; mod bitmap; mod continuation_table; mod crc32; mod gc; mod leb128; mod mark_stack; mod memory; mod principal_id; mod stream; mod text; mod utf8; use motoko_rts::types::Bytes; fn main() { if std::mem::size_of::<usize>() != 4 { println!("Motoko RTS only works on 32-b...
23.625
82
0.58664
abdcd56444213e121fbb7f023a6df1674716d554
2,409
// Copyright 2012-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...
38.238095
97
0.555002
ace4144e362a00c113f4c43b83baa1914ea038d7
35,215
use std::collections::VecDeque; use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll}; use std::{fmt, io, net}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed, FramedParts}; use actix_rt::time::{delay_until, Delay, Instant}; use actix_service::Service; use bitflags::bitflags; us...
36.606029
89
0.443873
9cc6ef348e6eeeb1bab52f9af40a25f2c74efaca
397
pub mod body; pub use self::body::Body; pub mod area; pub use self::area::Area; mod delay; pub use self::delay::Delay; pub mod header; pub mod log; mod message; pub use self::message::Message; pub mod name; pub use self::name::Name; mod named_values; pub use self::named_values::NamedValueVisitor; mod options; p...
14.178571
46
0.72796
698481e3737e4563bcf017671b106926d3391db7
28,044
use std::collections::HashMap; use std::io::{Read, Write}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use std::time::Duration; use brotli2::write::BrotliEncoder; use bytes::Bytes; use flate2::read::GzDecoder; use flate2::write::GzEncoder; use flate2::Compression; use futures::Future; use rand:...
32.16055
89
0.532627
d612ad3f764f20b2ee77e1d05e3f5d16c12f1091
2,732
//! Helper module which defines [`FuncArgs`] to make function calling easier. #![allow(non_snake_case)] use crate::types::dynamic::Variant; use crate::Dynamic; #[cfg(feature = "no_std")] use std::prelude::v1::*; /// Trait that parses arguments to a function call. /// /// Any data type can implement this trait in ord...
28.757895
117
0.495242
2f3f0802f74421badf65097bcadf7d54c7e75710
2,616
use crate::{ buffer_try_push_str, buffer_write_fmt, node_was_already_visited, sql_writer::SqlWriterLogic, truncate_if_ends_with_char, AuxNodes, SqlValue, SqlWriter, Table, TableDefs, TableFields, TableSourceAssociation, }; use core::fmt::Display; impl<'entity, B, TD> SqlWriterLogic<'entity, B, TD> where B: cl_...
30.068966
94
0.620413
69fae8c4b1d2846493b37e29d7d65a79b4cd2d54
884
use slog::{info, Logger}; mod observable_counting_semaphore; mod unix; pub use observable_counting_semaphore::*; pub use unix::{ensure_single_named_systemd_socket, incoming_from_first_systemd_socket}; /// Returns a `Future` that completes when the service should gracefully /// shutdown. Completion happens if either ...
31.571429
91
0.665158
7275921d09964b0cc4bf739180fdbb4a1a822b32
4,416
// Copyright 2022 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::{ abs_moniker::{AbsoluteMoniker, AbsoluteMonikerBase}, error::MonikerError, }, core::cmp::Ord, std::fmt, }; #...
33.969231
99
0.625453
ed2786edf3a3f25d9b09531b35a3dfb989578570
4,366
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
33.584615
97
0.540541
4ae438e6e61d88c3272352914ec6b90c52e0ff4b
2,217
use std::io; fn main() -> io::Result<()> { let mut config = prost_build::Config::new(); config .type_attribute(".test.Scalars", "#[cfg_attr(test, derive(::proptest_derive::Arbitrary))]") .type_attribute(".test.ScalarArrays", "#[cfg_attr(test, derive(::proptest_derive::Arbitrary))]") .ty...
42.634615
113
0.553
3846922cdd6ad28f9b3f04195684b4018b74e74f
598
#![allow(dead_code)] #![allow(unused_imports)] use itertools::Itertools; use proconio::marker::{Bytes, Chars, Usize1}; use proconio::*; use std::cmp::*; use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque}; use std::io; use std::mem::*; #[fastout] fn main() { input! { s: Char...
19.290323
83
0.521739
09de6ade5e019f0b21070fabf296a9521ac35e69
2,848
use crate::commands::WholeStreamCommand; use crate::data::TaggedListBuilder; use crate::prelude::*; use crate::utils::data_processing::{columns_sorted, t_sort}; use chrono::{DateTime, NaiveDate, Utc}; use nu_errors::ShellError; use nu_protocol::{ Primitive, ReturnSuccess, Signature, SyntaxShape, TaggedDictBuilder, ...
27.921569
101
0.573385
619e51774b20b5a6663f92d9b5465edb9239cd02
14
Hotel2.Hotel2
7
13
0.857143
0ef787c973396b69ae562a7a23b0d3e2db50577d
26,373
// This file is part of the SORA network and Polkaswap app. // Copyright (c) 2020, 2021, Polka Biome Ltd. All rights reserved. // SPDX-License-Identifier: BSD-4-Clause // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: ...
34.977454
135
0.598529
eb84204de9362259a7a485a6702a01d0ab828e3a
4,354
use std::collections::HashSet; use std::collections::VecDeque; use std::iter::FromIterator; use ring::digest; use PeerId; /// /// Inspector for incoming transitions. /// /// This trait has to be implemented for anyone using this library. It /// checks an unknown translation and gives functions to store such /// tr...
28.457516
95
0.53514
0e838854156f18986662c89c975b37d6a5a2f2d6
1,990
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
34.310345
63
0.731658
f797fab9a60053b2b7b63fd3ee05e5721c872578
314
//! Prints the runtime's execution log on the standard output. use async_std::task; fn main() { femme::with_level(log::LevelFilter::Trace); task::block_on(async { let handle = task::spawn(async { log::info!("Hello world!"); }); handle.await; }) }
19.625
63
0.547771
565b9c7b1ca546c1a080eae7425090ec2138dba0
543
use anyhow::{anyhow, Result}; pub(crate) fn get_with_default<T: std::str::FromStr>(key: &str, def: &str) -> Result<T, T::Err> { if let Ok(v) = dotenv::var(key) { if v == "" { def.to_owned().parse::<T>() } else { v.parse::<T>() } } else { def.to_owned().pa...
25.857143
97
0.467772
8994df73c1087f8a93ab90e78374eb523984d796
366
//! Tests auto-converted from "sass-spec/spec/non_conformant/basic/39_dash_match_attribute_selector.hrx" #[test] fn test() { assert_eq!( crate::rsass( "div[class|=\"blah\"] {\ \n color: blue;\ \n}" ) .unwrap(), "div[class|=blah] {\ \n co...
20.333333
104
0.464481
4a85bf4c772cfa7b5c7a4deec3dda1631dd73d2c
185
#[macro_use] extern crate xplane_plugin; use xplane_plugin::*; extern crate xplm; extern crate xpgl; extern crate mapcore; mod plugin; xplane_plugin!(plugin::TerrainDisplayPlugin);
14.230769
45
0.783784
6765932e732751b7f8a1b0380d93a6d0c65bd455
2,474
#[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::CSR5 { #[doc = r" Modifies the contents of the register"] #[inline] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut ...
23.339623
59
0.490299
018d67e78a38b65e37c2bc7df839d5cba926a605
730
#[cfg(test)] mod tests { use super::*; use crate::oxide::Oxide; #[test] fn create_oxide_app() { let app = Oxide::new(300, 400); assert_eq!(400 , app.settings.width); assert_eq!(300 , app.settings.height); assert_eq!(0 , app.settings.min_width); assert_eq!(0 ...
33.181818
61
0.609589
095059c5183676232c48b36093a244a9fe69ba3b
8,690
// This file is Copyright its original authors, visible in version control // history. // // This file is 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. // You may...
31.485507
125
0.646605
fe2cf2cb2f7dde5f36733411974c9bfecc5a2308
32,270
//! A basic table view implementation for [cursive](https://crates.io/crates/cursive). #![deny( missing_docs, missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code, unused_import_braces, unused_qualifications )] // Crate Dependencies -------------------------------...
30.472144
97
0.526557
67755d0715e659e74d1f21a7472625a3183d7b20
483
use rusoto_core::Region; pub const ENDPOINT: &str = "http://localhost:4566"; #[allow(dead_code)] pub fn setup() { std::env::set_var("AWS_REGION", "us-east-2"); std::env::set_var("AWS_ACCESS_KEY_ID", "test"); std::env::set_var("AWS_SECRET_ACCESS_KEY", "test"); std::env::set_var("AWS_ENDPOINT_URL", ENDP...
24.15
55
0.63354
8f837c3edab246b040c2a1c4098a7d40c78810ec
3,755
extern crate regex; use std::collections::VecDeque; use std::io; use std::io::prelude::*; use regex::Regex; #[derive(Debug)] struct Range((usize, usize), (usize, usize)); #[derive(Debug)] enum OperationType { On, Off, Toggle, } #[derive(Debug)] struct Operation { op_type: OperationType, rang...
27.210145
86
0.435686
d5680aad51f046919fc4924294a8564a324536a9
6,355
use disco::ed25519; use disco::x25519::{PublicKey, StaticSecret}; use disco::SessionBuilder; #[test] fn test_nn_session() { let mut session1 = SessionBuilder::new("NN").build_initiator(); let mut session2 = SessionBuilder::new("NN").build_responder(); println!("-> e"); let ct = session1.write_message(...
30.849515
83
0.626121
fb85b041ca8bdebbe79f15b45ec25114f8f9726b
3,016
// Copyright ⓒ 2015-2016 Kevin B. Knapp and [`clap-rs` contributors](https://github.com/clap-rs/clap/graphs/contributors). // Licensed under the MIT license // (see LICENSE or <http://opensource.org/licenses/MIT>) All files in the project carrying such // notice may not be copied, modified, or distributed except accord...
30.464646
138
0.664788
ed00eff53cdf03abd0b9f0500283d030367f2226
1,101
//! //! Support for Slack Webhooks methods //! use rsb_derive::Builder; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; use crate::SlackClient; use crate::{ClientResult, SlackClientHttpConnector}; use slack_morphism_models::*; impl<SCHC> SlackClient<SCHC> where SCHC: SlackClientHttpCo...
25.604651
67
0.704814
f79b4ea0e6eac0e0e2e5372fddd710df01b1ee18
502
#![allow(unused_imports)] use wasm_bindgen::prelude::*; #[wasm_bindgen] #[doc = "The `PcImplIceConnectionState` enum."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `PcImplIceConnectionState`*"] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum PcImplIceConnectionState { ...
29.529412
103
0.673307
b918ba3bd8e77702bab7b902030b8ab5bb2dbe48
2,774
use std::rc::Rc; use glium::{Display, Surface, Frame}; use color::Color; use render::{Renderable, Renderer}; use texture::Texture; use mesh::{VertexBuffer, IndexBuffer, Polygon, Mesh}; use math::Mat; use sprite::Sprite; pub struct Batch { texture: Rc<Texture>, mesh: Mesh, color_multiply: Color, } impl ...
26.932039
76
0.483417
69ddf958a5d464ca7cde08316b6a2ddcde316f04
3,840
use ::chrono::prelude::*; use ::serde_derive::{Deserialize, Serialize}; use ::std::collections::HashMap; use ::strum_macros::Display; /// This enum represents the status of the internal task handling of Pueue. /// They basically represent the internal task life-cycle. #[derive(Clone, Debug, Display, PartialEq, Seriali...
30.72
101
0.607031
019f7a5acedafe9149496a72fc75e33750ad5c04
1,538
// ================================================================= // // * WARNING * // // This file is generated! // // Changes made to this file will be overwritten. If changes are // required to the generated code, the service_crategen project // must be updated to ...
53.034483
708
0.671001
1e19401479687815644a47d24a7849c3341ac789
6,745
// This test case tests the incremental compilation hash (ICH) implementation // for match expressions. // The general pattern followed here is: Change one thing between rev1 and rev2 // and make sure that the hash has changed, then change nothing between rev2 and // rev3 and make sure that the hash has not changed. ...
21.144201
83
0.489548
89420a4227e712cd78470664d1af7c8ea4ae90c7
5,184
use core::marker::PhantomData; use core::mem::MaybeUninit; use cortex_m::peripheral::scb::VectActive; use cortex_m::peripheral::{NVIC, SCB}; use embassy::interrupt::{Interrupt, InterruptExt}; /// A type which can be used as state with `PeripheralMutex`. /// /// It needs to be `Send` because `&mut` references are sent...
33.019108
148
0.593171
e57c6eb3e671db64e99ab34f6a3a81b6f8ff7abb
20,986
use crate::{ command::Command, physics::{Collider, Joint, RigidBody}, scene::commands::SceneContext, Physics, }; use rg3d::{ core::{ algebra::{UnitQuaternion, Vector3}, pool::{ErasedHandle, Handle, Ticket}, }, physics3d::desc::{ColliderShapeDesc, JointParamsDesc}, scene::...
34.179153
173
0.614553
ac4b3b5d13ca0a25836c63ffdc4be02b38b5ece0
1,957
use std::ops::{Deref, DerefMut}; pub trait SizedArray<T>: Copy + Clone { type Storage: AsRef<[T]> + AsMut<[T]> + Copy + Clone; const ROWS: usize; const COLS: usize; fn all(alpha: T) -> Self::Storage; } macro_rules! sized_array_impl { ($type: ident, $rows: expr, $cols: expr) => { #[derive(Copy, Clone)] pub s...
20.819149
83
0.652529
39343aa694879990ddef190402537eba2b76789f
9,710
mod extension; mod mock_types; mod pallet_pink; use std::time::{Duration, Instant}; use crate::types::{AccountId, Balance, BlockNumber, Hash, Hashing, Index}; use frame_support::{ parameter_types, traits::ConstU128, weights::{constants::WEIGHT_PER_SECOND, Weight}, }; use pallet_contracts::{Config, Frame, ...
32.693603
100
0.602678
080760aa81f30013d37fd6f2f2ee7764530577be
108,275
//! Compiler intrinsics. //! //! The corresponding definitions are in `librustc_codegen_llvm/intrinsic.rs`. //! The corresponding const implementations are in `librustc_mir/interpret/intrinsics.rs` //! //! # Const intrinsics //! //! Note: any changes to the constness of intrinsics should be discussed with the language ...
47.447415
107
0.630681
f8b198da3e6f1db625aee7ad42afff71e62c8764
4,443
//! # SSSF - Super Simple Simulation Framework //! //! It's crate that lets you write Rust physics simulations without boring and repetetive boilerplate. I created this for my personal usage because of my Uni classes in which we wrote lots of physical simulations but now I want to share because I think it's pretty eleg...
60.040541
518
0.682872
388fc357b040f7a30a55d2f584fbbd4fa75e7379
131
pub mod ownable_instruction; pub mod ownable_processor; panoptes_sdk::declare_id!("ownab1e111111111111111111111111111111111111");
26.2
73
0.862595
fea63de9f7b61e944b5ab3469a8f4dd607f4e8c5
3,731
use serde::{Deserialize, Deserializer}; /// This helper function enables successful deserialization of versioned structs; new structs may /// include additional fields if they impl Default and are added to the end of the struct. Right /// now, this function is targeted at `bincode` deserialization; the error match may...
28.265152
99
0.459126
03670a34cc6dbdf05aef11a9ad8a37528387e2fc
1,306
extern crate clap; use byte_unit::{AdjustedByte, ByteUnit}; use clap::Parser; use cli::Cli; use std::{ fs::{self, File}, io::Write, process, }; mod cli; fn main() -> compacto::Result<()> { let matches: Cli = Cli::parse(); let input = match fs::read_to_string(&matches.input) { Ok(input) =...
26.12
100
0.559724
71c93a04ce552e75d713aacd6d41e7603d52eb6e
1,023
/** 给你一个整数 num,请你找出同时满足下面全部要求的两个整数: 两数乘积等于  num + 1 或 num + 2 以绝对差进行度量,两数大小最接近 你可以按任意顺序返回这两个整数。   示例 1: 输入:num = 8 输出:[3,3] 解释:对于 num + 1 = 9,最接近的两个因数是 3 & 3;对于 num + 2 = 10, 最接近的两个因数是 2 & 5,因此返回 3 & 3 。 示例 2: 输入:num = 123 输出:[5,25] 示例 3: 输入:num = 999 输出:[40,25]   提示: 1 <= num <= 10^9 来源:力扣(LeetCode) 链接:https:...
16.238095
79
0.542522
c1c7bb927492e42cf255b765d4b74518b6cc1dda
5,571
//! Provides a (currently mediocre) virtual address allocator, //! which allocates pages (not physical memory) starting from kernel_config::memory::KERNEL_TEXT_START. //! The minimum unit of allocation is a single page. use core::ops::Deref; use kernel_config::memory::{KERNEL_TEXT_START, KERNEL_TEXT_MAX_SIZE, PAGE_S...
34.177914
115
0.71944
f8c3800583fe96f9fc0782339505ac2a3372aaf4
775
pub struct Heap {} pub struct HeapGuard<'a> { heap: &'a Heap } impl Heap { pub fn new() -> Self { Heap {} } pub fn activate(&mut self) -> HeapGuard { unimplemented!() } } // struct SwappableAllocator; // // unsafe impl GlobalAlloc for Allocator { // unsafe fn alloc(&self, layo...
22.794118
91
0.552258
0178be80cb05aeb729ce2831466b828b047c7edb
36,499
//! Error and Result module use std::cell::RefCell; use std::io::Write; use std::str::Utf8Error; use std::string::FromUtf8Error; use std::{fmt, io, result}; use bytes::BytesMut; use derive_more::{Display, From}; use http::uri::InvalidUri; use http::{header, Error as HttpError, StatusCode}; use serde::de::value::Error...
30.748947
99
0.646703
de31e814252b94c73aa7e1f3b44055a5bbd7f67f
5,669
use crate::leader_arrange::LeaderSchedule; use crate::staking_utils; use morgan_runtime::bank::Bank; use morgan_interface::pubkey::Pubkey; use morgan_interface::timing::NUM_CONSECUTIVE_LEADER_SLOTS; use proptest::{ strategy::{Strategy, ValueTree}, test_runner::{Config, TestRunner}, }; /// Return the leader sch...
33.744048
100
0.637502
f4536f9c9e2189f97aaf1e9b8f652218b87e647e
149
// compile-flags: -W bad-style // check-pass fn main() { let _InappropriateCamelCasing = true; //~^ WARNING should have a snake case name }
18.625
46
0.66443
23f88097de9b4177fb59d0d7b5df7ef6864449e4
1,847
//! Gameboard controller. use piston::Event; use piston::input::GenericEvent; use crate::gameboard::{Direction, Gameboard}; /// Handles events for Sudoku game. pub struct GameboardController { /// Stores the gameboard state. pub gameboard: Gameboard, } impl GameboardController { /// Creates a new gameboa...
31.844828
71
0.421765
0a1ead005e89c9002c1e376d66f5150f17d0cc21
2,377
use hamcrest2::core::Matcher; use support::sandbox::sandbox; use test_support::matchers::execs; use notion_fail::ExitCode; const BASIC_PACKAGE_JSON: &'static str = r#"{ "name": "test-package" }"#; fn package_json_with_pinned_node(node: &str, npm: &str) -> String { format!( r#"{{ "name": "test-package...
22.424528
72
0.549432
d6ba3063676342141c8d55deb83ac95368983874
4,488
//! Everything needed to handle and create commands use super::command::Command; use crate::{ context::BotContext, database::User, handler::{Handler, SimpleHandler, Twitch}, message::{Message, MessageConsumer, MessageResult}, }; use anyhow::{Context, Result}; use async_trait::async_trait; use std::{coll...
30.951724
93
0.547906
4abe5b1c0507199f2f2d95879bf73bc10eef0076
4,413
use core::fmt; use std::{num::NonZeroUsize, time::Duration}; use criterion::{ criterion_group, measurement::WallTime, BatchSize, BenchmarkGroup, BenchmarkId, Criterion, SamplingMode, Throughput, }; use vector::transforms::dedupe::{CacheConfig, Dedupe, DedupeConfig, FieldMatchConfig}; use vector_core::transform...
35.58871
100
0.5477
75864f0cceeaa4b51f7f707539d5725410f4224b
9,702
//! Minkowski sum. use std::ops::{Index, IndexMut, Add, Sub, Mul, Div, Neg}; use na::{Dim, ApproxEq, Orig, PntAsVec, Axpy, Translate, NumPnt, NumVec, POrd, POrdering, ScalarSub, ScalarAdd, ScalarMul, ScalarDiv, FloatPnt, Bounded}; use na; use shape::Reflection; use math::{Scalar, Point, Vect}; /// Type of a...
24.5
102
0.564523
ffc26738dd7b2d7ca23d73eb9f98d08e833751c8
62,272
// 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...
34.461538
97
0.52579
f8668ddbd0709e08706c30e120735ac96042ff88
16,852
use super::{conv, HResult as _}; use std::{mem, sync::Arc, thread}; use winapi::{ shared::{dxgi, dxgi1_2, dxgi1_5, minwindef, windef, winerror}, um::{d3d12, d3d12sdklayers, winuser}, }; impl Drop for super::Adapter { fn drop(&mut self) { // Debug tracking alive objects if !thread::panicking...
39.651765
103
0.549905
d6b3e674f8f804878c727db063d25736b3f47ae2
22,819
// Copyright 2012-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...
43.54771
100
0.430212
d76cd02380c797865b8be24f38dfa925e81395b5
26,959
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. #[non_exhaustive] #[derive(std::clone::Clone, std::cmp::PartialEq)] pub struct StartSnapshotOutput { /// <p>The description of the snapshot.</p> pub description: std::option::Option<std::string::String>, /// <p>The ID of the sn...
44.340461
127
0.610816
6431b7a20bd5936cf5d07f8aac40165d237ffb2f
2,972
use std::{convert::Infallible, marker::PhantomData}; use bytes::{Buf, Bytes, BytesMut}; use futures::{ channel::{self, mpsc::UnboundedReceiver}, stream, Stream, StreamExt, }; use hyper::{body, Body, Request, Response, StatusCode}; use serde::{Deserialize, Serialize}; use super::{Handler, HandlerFn}; use crate...
25.401709
90
0.586474
db8c6a6b8acfc76388ce24fffaff09973deacdfd
638
extern crate zbx_sender; use std::env; use zbx_sender::{Response, Result, Sender}; fn send_one_value(command: &str) -> Result<Response> { let sender = Sender::new(command.to_owned(), 10051); sender.send(("host1", "key1", "value")) } fn main() { let command = match env::args().nth(1) { Some(cmd) =...
25.52
86
0.545455
efceff1afcf308a93b71d4c19842e1a1b23045ee
1,550
pub struct IconIceSkating { props: crate::Props, } impl yew::Component for IconIceSkating { type Properties = crate::Props; type Message = (); fn create(props: Self::Properties, _: yew::prelude::ComponentLink<Self>) -> Self { Self { props } } fn update(&mut self, _: Self::Message) -> ...
33.695652
355
0.584516
f52a64d40b266df70e5e77eee24b895c02e658be
89
mod conf; pub mod handler; pub mod input; pub mod opt; pub mod output; pub use conf::*;
11.125
16
0.696629
382c4a3fa670fd49f96cbab2b7b2fb0346371af6
4,957
#![feature(test)] #![feature(specialization)] use std::alloc::System; #[global_allocator] static GLOBAL: System = System; #[macro_use] extern crate swc_common; extern crate swc_ecma_ast; extern crate swc_ecma_parser; extern crate swc_ecma_transforms; extern crate test; extern crate testing; use swc_common::{FileName,...
19.907631
71
0.575953
e61d63f96276fff3ca3c408c8d795125b611ebef
4,607
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/vhdirk/gir-files.git) // DO NOT EDIT use crate::Certificate; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "GMimeCertificateList")] pub struct CertificateList(O...
28.974843
98
0.585196
cc0f55af26987635cee7d65677c7eeb1e5dbc741
3,606
// Copyright 2017 The syscall.rs Project Developers. See the // COPYRIGHT file at the top-level directory of this distribution. // // Licensed under the Apache License, Veecxon 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>...
26.910448
77
0.415141
5d1baae9f71c47bfffce12234fb77f4d73e9fb1c
722
// 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::factory_reset::{facade::FactoryResetFacade, types::FactoryResetMethod}; use crate::server::Facade; use anyhow::Error; use async_trait::async_t...
32.818182
90
0.663435
891780ca1981435638ae8c350dd7a8eaa5673af2
1,919
/* Copyright 2020 Takashi Ogura 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...
29.075758
108
0.60865
0903ef8a7df4a9d1e973b753c8635ab3dfe0e765
3,731
#[doc = "Register `PROC_IN_SYNC_BYPASS` reader"] pub struct R(crate::R<PROC_IN_SYNC_BYPASS_SPEC>); impl core::ops::Deref for R { type Target = crate::R<PROC_IN_SYNC_BYPASS_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<PROC_IN_SYNC_BYPASS_SPEC>> for R ...
33.612613
300
0.656928
79c7c6131a26a5a25d76ac45308c2d642c328485
7,418
//! Version 1 (RFC 1157) use rasn::{ types::{Integer, ObjectIdentifier, OctetString}, AsnType, Decode, Encode, }; use smi::v1::{NetworkAddress, ObjectName, ObjectSyntax, TimeTicks}; #[derive(AsnType, Debug, Clone, Decode, Encode)] pub struct Message<T> { pub version: Integer, pub community: OctetStrin...
34.184332
97
0.501078
f9622dadd57e8f82f5591f0c5ea20ed6552149d6
2,989
#![allow(clippy::module_inception)] #![allow(clippy::too_many_arguments)] #![allow(clippy::ptr_arg)] #![allow(clippy::large_enum_variant)] #![doc = "generated by AutoRust 0.1.0"] #[cfg(feature = "package-preview-2021-09")] pub mod package_preview_2021_09; #[cfg(all(feature = "package-preview-2021-09", not(feature = "no...
40.945205
130
0.702911
acb06b5b86324d5eadab9c2992b6b5a1fcc0d43b
7,943
use async_trait::async_trait; use super::*; use crate::error::TaskError; use crate::task::{Request, Task, TaskOptions}; use chrono::{DateTime, SecondsFormat, Utc}; use std::time::SystemTime; #[derive(Clone, Serialize, Deserialize)] struct TestTaskParams { a: i32, } struct TestTask { request: Request<Self>, ...
33.944444
178
0.590079
21b8898a51293fda91078dfe36c6d5df874ee165
2,639
//! Rust implementation of Amazon's Ion data format //! //! There you go #![recursion_limit = "197"] #![feature(custom_attribute)] #![allow(unreachable_code)] #[macro_use] extern crate pest; extern crate num_bigint; extern crate num_bigdecimal; extern crate num_rational; use num_bigint::BigInt; use num_bigdecimal::...
21.112
71
0.68094
7941a1f90e01621701fcccaa82d7148091a2d1ab
5,885
//! Activity argument parsing use crate::Command; use clap::{App, AppSettings, ArgMatches, SubCommand}; pub(super) const BASE: &'static str = "activity"; pub(super) const BASE_GOALS: &'static str = "goals"; pub(super) const BASE_LIFETIME_STATS: &'static str = "lifetime_stats"; pub(super) const BASE_SUMMARY: &'static...
47.08
100
0.575021
90b03d569ba39b5a9235940e468ccc95f9494ca0
20,382
//! Create interactive, native cross-platform applications. mod state; pub use state::State; use crate::clipboard::{self, Clipboard}; use crate::conversion; use crate::mouse; use crate::{ Color, Command, Debug, Error, Executor, Mode, Proxy, Runtime, Settings, Size, Subscription, }; use iced_futures::futures;...
31.6
80
0.521048