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 |
|---|---|---|---|---|---|
61ebd653b71e25e837b126bcd8a95f9233dbfde8 | 82,007 | // Copyright 2018 Mozilla
//
// 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... | 35.226375 | 153 | 0.693234 |
9b57d815b6608693516d7fd03792d85ecc067e32 | 7,122 | use std::fmt;
use approx::{ulps_eq, ulps_ne};
use cgmath::prelude::*;
use cgmath::{AbsDiffEq, RelativeEq, UlpsEq};
use cgmath::{BaseFloat, Point3, Vector3, Vector4};
use crate::prelude::*;
use crate::Ray3;
/// A 3-dimensional plane formed from the equation: `A*x + B*y + C*z - D = 0`.
///
/// # Fields
///
/// - `n`: ... | 29.308642 | 96 | 0.535805 |
d997130a8f16fe6dd2e7b7e0a5af78574c9f657f | 13,805 | // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use std::f64::INFINITY;
use std::path::Path;
use std::sync::Arc;
use std::thread;
use std::time::Duration;
use engine_rocks::raw::{IngestExternalFileOptions, Writable};
use engine_rocks::util::get_cf_handle;
use engine_rocks::util::new_temp_engine;
us... | 32.71327 | 95 | 0.581384 |
e6f550f03fc4a720c7dec07c56f010039a626cd6 | 1,068 | pub mod scripts;
use serde::{Deserialize, Serialize};
use std::error::Error;
#[derive(Serialize, Deserialize, Debug)]
pub struct DeepLink {
pub link: Option<String>,
pub title: Option<String>,
}
pub const UNKNOWN: DeepLink = DeepLink {
link: None,
title: None,
};
#[derive(Serialize, Deserialize, Debu... | 28.105263 | 91 | 0.613296 |
f8c6b00f700ca3eccd777d422f75b91963e3fbe9 | 1,713 | use super::{
super::tui_utils::Event,
text::{generate_help_text, generate_info_text},
LedgerList, LedgerTab, LedgerTabState, Trans,
};
use termion::event::Key;
pub fn event(tab: &mut LedgerTab, event: Event<Key>) -> Trans {
if event == Event::Input(Key::Delete) {
if tab.active_list == LedgerLis... | 34.959184 | 66 | 0.545242 |
3adfa89b83354b1717fa03d3ca9df020d042287e | 49 | pub mod color;
pub mod spinner;
pub mod styling;
| 12.25 | 16 | 0.755102 |
0e862da96bf3ca0a38a35b72c9b4dcf52dd2d5bf | 31,472 | use libc::c_char;
use utils::cstring::CStringUtils;
use utils::error;
use connection;
use disclosed_proof;
use std::ptr;
use utils::threadpool::spawn;
use error::prelude::*;
/// Create a proof for fulfilling a corresponding proof request
///
/// #Params
/// command_handle: command handle to map callback to user contex... | 44.016783 | 362 | 0.592972 |
381ea168a286d0144a3e460942c46e2b81224ef0 | 1,114 | use crate::common::util::*;
#[test]
fn test_link_existing_file() {
let (at, mut ucmd) = at_and_ucmd!();
let file = "test_link_existing_file";
let link = "test_link_existing_file_link";
at.touch(file);
at.write(file, "foobar");
assert!(at.file_exists(file));
ucmd.args(&[file, link]).succee... | 26.52381 | 76 | 0.632855 |
33e6eeee06500c1d5bba8b24e3dba4b694732a73 | 5,709 | #![allow(warnings, clippy, unknown_lints)]
use std::{io::Result, path::PathBuf, process::exit};
pub type Identifier = String;
pub type StringLiteral = String;
pub mod asm;
pub mod hir;
pub mod mir;
use hir::HirProgram;
mod target;
pub use target::{Go, Target, C};
use asciicolor::Colorize;
use comment::cpp::strip;
u... | 32.622857 | 97 | 0.541776 |
6ad7552a7dc8a29996d76897b765a1c84485a1fc | 17,937 | pub(crate) mod debug;
pub(crate) mod into_shapes;
pub(crate) mod pattern;
pub(crate) mod state;
use self::debug::ExpandTracer;
use self::into_shapes::IntoShapes;
use self::state::{Peeked, TokensIteratorState};
use crate::hir::syntax_shape::flat_shape::{FlatShape, ShapeResult};
use crate::hir::syntax_shape::{ExpandCon... | 29.746269 | 117 | 0.557005 |
18ac61b3bcc3b517e9d3eb455c9fb7e2d1664e7d | 105 | fn main() {
let mut v = [-5, 4, 1, -3, 2];
v.sort();
assert!(v == [-5, -3, 1, 2, 4]);
}
| 15 | 36 | 0.333333 |
50bddc049100a3d1484cb0a4694b309a2bd01080 | 26,120 | use std::iter;
use cgmath::prelude::*;
use wgpu::util::DeviceExt;
use winit::{
event::*,
event_loop::{ControlFlow, EventLoop},
window::Window,
};
mod camera;
mod model;
mod texture; // NEW!
use model::{DrawLight, DrawModel, Vertex};
const NUM_INSTANCES_PER_ROW: u32 = 10;
#[repr(C)]
#[derive(Copy, Clone... | 36.73699 | 107 | 0.501149 |
d7688a19e9af6f8a8cbe1ed50fa9179068e4728a | 456,227 | #![doc = "generated by AutoRust 0.1.0"]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
use crate::models::*;
pub mod recoverable_databases {
use crate::models::*;
pub async fn get(
operation_config: &crate::OperationConfig,
subscription_id: &str,
resource_gro... | 48.267774 | 309 | 0.595397 |
8f007be6f6902922c77ebbecb43b22ce24192125 | 13,289 | use std::net::{Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6};
use bytes::{Buf, BufMut};
use err_derive::Error;
use crate::coding::{BufExt, BufMutExt, UnexpectedEnd};
use crate::packet::ConnectionId;
use crate::{
varint, Side, TransportConfig, TransportError, MAX_CID_SIZE, MIN_CID_SIZE, RESET_TOKEN_SIZE,
VER... | 34.697128 | 135 | 0.513432 |
21d43e26b3a2961c13f4fb4a0c54e6b006f89427 | 6,586 | use zygote::Zygote;
use std::fmt;
use gen::Gen;
#[derive(Clone)]
pub struct Chromosome {
dominant: Zygote,
recessive: Zygote,
pub decoded: Vec<u64>,
}
impl fmt::Display for Chromosome {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}\n{}", self.dominant, self.recessive)
... | 33.095477 | 99 | 0.600213 |
0ea545c25e5060be60353c77f1f3ea6028be11a2 | 13,639 | use std::fs;
use std::sync::Once;
use crate::{libindy, settings, utils};
use crate::agency_client::mocking::AgencyMockDecrypted;
use crate::init::{init_issuer_config, open_as_main_wallet};
use crate::init::PoolConfig;
use crate::libindy::utils::pool::reset_pool_handle;
use crate::libindy::utils::pool::test_utils::{cre... | 30.04185 | 157 | 0.67351 |
f5f66fd42efbbe4c603e3d251a3b872fdea86122 | 11,515 | //! Support for a calling of an imported function.
use pyo3::prelude::*;
use pyo3::types::{PyAny, PyDict, PyTuple};
use crate::code_memory::CodeMemory;
use crate::function::Function;
use crate::memory::Memory;
use crate::value::{read_value_from, write_value_to};
use cranelift_codegen::ir::types;
use cranelift_codegen... | 32.164804 | 98 | 0.592358 |
bf6c345d59e182a4bbe7aabacfb70eb8982a5980 | 1,517 | use crate::input::structures;
use crate::{input::rooms, protos::cao_commands};
use tonic::{Request, Response, Status};
use tracing::info;
#[derive(Clone)]
pub struct CommandService {
world: crate::WorldContainer,
}
impl std::fmt::Debug for CommandService {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std... | 32.276596 | 78 | 0.637442 |
723ceb807435a4e3e809bee6aa6db4606184504f | 47,287 | #![allow(unused_imports, non_camel_case_types)]
use crate::model::CodeableConcept::CodeableConcept;
use crate::model::ContactDetail::ContactDetail;
use crate::model::Element::Element;
use crate::model::Extension::Extension;
use crate::model::Identifier::Identifier;
use crate::model::Meta::Meta;
use crate::model::Narra... | 34.043916 | 100 | 0.545731 |
6ae5bf8fc7215e15821b87d0b8581411a8ebe801 | 1,577 | #[test]
fn margin_and_flex_row() {
let mut stretch = stretch::Stretch::new();
let node0 = stretch
.new_node(
stretch::style::Style {
flex_grow: 1f32,
margin: stretch::geometry::Rect {
start: stretch::style::Dimension::Points(10f32),
... | 38.463415 | 80 | 0.538998 |
0ec4b2790f0fd6cfda5907f35e9a47b4550b9be7 | 4,929 | use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Instant, Duration};
use gilrs::{Gilrs, Button, Axis};
use multiinput::{RawInputManager, RawEvent};
use pad_motion::protocol::*;
use pad_motion::server::*;
fn main() {
let running = Arc::new(AtomicBool::new(true));
{
let runni... | 37.340909 | 91 | 0.654088 |
c13e543da05598456f2761fca652c5459e9a5972 | 12,453 | //! Module for kernels
//!
//! Currently used within Gaussian Processes and SVMs.
use std::ops::{Add, Mul};
use linalg::Vector;
use linalg::norm::{Euclidean, VectorNorm, VectorMetric};
use rulinalg::utils;
/// The Kernel trait
///
/// Requires a function mapping two vectors to a scalar.
pub trait Kernel {
/// Th... | 24.227626 | 94 | 0.549105 |
7ad61aa90077f756651a1231191702b0f298273e | 818 | use lsp_types::request::Request;
use lsp_types::Range;
use lsp_types::TextDocumentIdentifier;
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct SyntaxTreeParams {
pub text_document: TextDocumentIdentifier,
}
pub enum SyntaxTree {}
impl Req... | 24.058824 | 51 | 0.729829 |
dd0112847f079d88e4aac71fb5def93ef51f6110 | 4,774 | pub mod clients;
mod connection_string;
mod connection_string_builder;
mod copy_id;
mod copy_progress;
mod errors;
mod into_azure_path;
pub mod prelude;
pub mod shared_access_signature;
use std::convert::TryInto;
pub use self::connection_string::{ConnectionString, EndpointProtocol};
pub use self::connection_string_bui... | 29.8375 | 95 | 0.647884 |
bfc7bdc9badb05a99c37ae96d64023b0652f19db | 353 | use crate::transformer::transformers;
use crate::utils::table;
/// display all transformers available
pub fn list() {
let mut table = table();
table.set_titles(row!["name", "description"]);
for transformer in transformers() {
table.add_row(row![transformer.id(), transformer.description()]);
}
... | 23.533333 | 73 | 0.660057 |
9c4cc58daec0fe1d5cbcc0e4f7ccd73423e6389d | 1,146 | use crate::result::*;
use crate::svc;
use crate::crt0;
use crate::ipc::sf;
use crate::service;
use crate::service::fatal;
use crate::service::fatal::IService;
use core::mem;
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum AssertMode {
ProcessExit,
FatalThrow,
SvcBreak,
Panic
}
pub fn assert(mode... | 27.95122 | 116 | 0.487784 |
75c1aa0f49a7f3f03902b871a332ad0bf1fadb13 | 3,996 | // Copyright (c) 2021, BlockProject 3D
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list ... | 28.140845 | 108 | 0.64014 |
2132c956fe7f26ef89bcf51824c1a395f3535e24 | 4,927 | use std::error::Error as _;
use std::io;
use time::error::{
ComponentRange, ConversionRange, Error, Format, IndeterminateOffset, InvalidFormatDescription,
Parse, ParseFromDescription, TryFromParsed,
};
use time::format_description::{self, modifier, Component, FormatItem};
use time::macros::format_description;
... | 31.787097 | 98 | 0.676477 |
483ff8ebcd214f09d362b31822ecb19f903c4cc6 | 975 | use std::sync::Arc;
use std::time::Duration;
use tokio::{sync::Mutex, task};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
console_subscriber::init();
task::Builder::default()
.name("main-task")
.spawn(async move {
let count = Arc::new(Mute... | 30.46875 | 77 | 0.420513 |
482636a6c51c55ba7b9fba7c33be62c3f3ec05ef | 7,038 | use crate::thread_worker::Worker;
use crate::types::*;
use crossbeam_channel::{Receiver, Sender, TryRecvError};
use jsonrpc_core::{self, Call, Output};
use std::collections::HashMap;
use std::io::{self, BufRead, BufReader, BufWriter, Error, ErrorKind, Read, Write};
use std::process::{Command, Stdio};
pub struct Langua... | 36.848168 | 98 | 0.52998 |
dd339456a6d4673506e10287f518289654839e0f | 4,713 | //! Type names for rkyv_dyn.
//!
//! The goal of `TypeName` is to avoid allocations if possible. If all you need is the hash of a
//! type name, then there's no reason to allocate a string to do it.
//!
//! rkyv_typename provides a derive macro to easily implement [`TypeName`], and has options to
//! easily customize y... | 28.053571 | 100 | 0.572884 |
9cb7f0b47cdaef6d5ff25d38c4d844f778d28c9f | 13,274 | #[doc = "Reader of register RTC_CNTL_RESET_STATE"]
pub type R = crate::R<u32, super::RTC_CNTL_RESET_STATE>;
#[doc = "Writer for register RTC_CNTL_RESET_STATE"]
pub type W = crate::W<u32, super::RTC_CNTL_RESET_STATE>;
#[doc = "Register RTC_CNTL_RESET_STATE `reset()`'s with value 0"]
impl crate::ResetValue for super::RTC... | 35.778976 | 100 | 0.632063 |
f486eb980f2b805113365051d415ea10db33ceab | 1,419 | use bytecodec;
use std;
use trackable::error::TrackableError;
use trackable::error::{ErrorKind as TrackableErrorKind, ErrorKindExt};
use url;
/// This crate specific `Error` type.
#[derive(Debug, Clone)]
pub struct Error(TrackableError<ErrorKind>);
derive_traits_for_trackable_error_newtype!(Error, ErrorKind);
impl Fro... | 28.959184 | 76 | 0.658915 |
5bd77fec93b8b0785b9eeece324df6a2764cdc94 | 408 | use enums;
#[derive(Clone, Debug)]
pub struct AVG {
pub issues: Vec<String>,
pub fixed: Option<String>,
pub severity: enums::Severity,
pub status: enums::Status,
}
impl Default for AVG {
fn default() -> AVG {
AVG {
issues: vec![],
fixed: None,
severity: ... | 19.428571 | 47 | 0.539216 |
1d6f32749df9b36cb64c8428c5ba9c45398c88f0 | 7,072 | use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub struct Board {
board: Vec<Cell>,
}
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = console)]
fn log(message: String);
}
#[wasm_bindgen]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum Cell {
EMPTY = 0,
PLAYER1 = 1,
PLAYER2 = 2,
... | 25.904762 | 69 | 0.536765 |
2246729429a72e1a440dde1d6d45fcb71f8ba3e7 | 4,350 | /// Storage formats, and io functions for rbspy's internal raw storage format.
///
/// rbspy has a versioned "raw" storage format. The versioning info is stored,
/// along with a "magic number" at the start of the file. The magic number plus
/// version are the first 8 bytes of the file, and are represented as
///
/// ... | 30.208333 | 86 | 0.594253 |
4b7edda3cf860d03d08c0afa6a3e4df4fd60195b | 1,480 | /*
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 not use this f... | 37.948718 | 112 | 0.782432 |
ac42dde4de9e9c3bfe5090a4c3bff66682122b4d | 1,582 | // errors2.rs
// Say we're writing a game where you can buy items with tokens. All items cost
// 5 tokens, and whenever you purchase items there is a processing fee of 1
// token. A player of the game will type in how many items they want to buy,
// and the `total_cost` function will calculate the total number of token... | 35.954545 | 81 | 0.692162 |
39e97be7770c2418110b6765b39892582bed8ac9 | 50,116 | #![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused)]
#![allow(clippy::all)]
use libc::timespec;
/* automatically generated by rust-bindgen */
pub const FIO_IOOPS_VERSION: u32 = 24;
pub type __uint8_t = libc::c_uchar;
pub type __uint16_t = libc::c_ushort;
pub typ... | 34.778626 | 100 | 0.714203 |
ef79582ce62e1b82c1af1f5fef5fd1932b191149 | 12,626 | use std::{cell::RefCell, collections::BTreeMap};
use dces::prelude::{Entity, EntityComponentManager};
use crate::{css_engine::*, prelude::*, render::*, shell::WindowShell, tree::Tree};
use super::{MessageBox, WidgetContainer};
/// The `Context` is provides access for the states to objects they could work with.
pub ... | 33.052356 | 109 | 0.559164 |
75c43acd95359539e6519fb8e8f9d249180fc3ae | 2,116 | //! De-/serialization functions for `std::time::SystemTime` objects represented as seconds since
//! the UNIX epoch. Delegates to `js_int::UInt` to ensure integer size is within bounds.
use std::{
convert::TryFrom,
time::{Duration, SystemTime, UNIX_EPOCH},
};
use js_int::UInt;
use serde::{
de::{Deserializ... | 29.388889 | 98 | 0.651701 |
e96004023039dea21d6bad9626dafb587d9dc730 | 4,072 | use crate::value::RefVal;
use crate::RefType;
use crate::host::HostFuncBody;
use crate::inst::*;
use crate::module::*;
use crate::value::Value;
use anyhow::Result;
use std::iter;
use wasmparser::{FuncType, FunctionBody, Type};
#[derive(Clone, Copy, Debug)]
pub struct InstIndex(pub u32);
impl InstIndex {
pub fn z... | 24.829268 | 99 | 0.551326 |
18e1489b994a597d04be23733930e33b3d28e0a2 | 21,028 | use {
crate::parse_instruction::{
check_num_accounts, ParsableProgram, ParseInstructionError, ParsedInstructionEnum,
},
bincode::deserialize,
serde_json::json,
solana_sdk::{
instruction::CompiledInstruction, pubkey::Pubkey, system_instruction::SystemInstruction,
},
};
pub fn par... | 41.805169 | 106 | 0.514124 |
08211ee33575f7cca4335b50cdcf706412644db3 | 62,639 | use crate::ops::*;
use std::cell::Cell;
#[derive(Default, Debug, Copy, Clone)]
pub struct CpuPinIn {
pub data: u8,
pub irq: bool,
pub nmi: bool,
pub reset: bool,
pub power: bool,
pub dmc_req: Option<u16>,
pub oam_req: Option<u8>,
}
#[derive(Debug, Copy, Clone)]
enum PendingDmcRead {
Pe... | 33.177436 | 100 | 0.481856 |
ab0696c86c86af3fccdee9e8a387c6e00f5334dc | 2,718 | use crate::graph::{Graph, GraphError};
use std::ops::Add;
type Parents = Vec<Option<usize>>;
type Distances<T> = Vec<Option<T>>;
impl <T> Graph<T> where T : PartialOrd + Copy + Default + Add<Output = T> {
pub fn bellman_ford(&self, from: usize) -> Result<(Parents, Distances<T>), GraphError> {
if from >= s... | 38.28169 | 103 | 0.533481 |
3a4516aceafd54e1db80d186f05142989bd7a3af | 21,812 | // Copyright (c) The Dijets Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! This module contains verification of usage of dependencies for modules and scripts.
use move_binary_format::{
access::{ModuleAccess, ScriptAccess},
binary_views::BinaryIndexedView,
errors::{verification_error, Location... | 40.243542 | 130 | 0.603429 |
8aac93f0777281cbfbbe362be7fa06563d7484cd | 2,003 | #[doc = "Register `PCCR45` reader"]
pub struct R(crate::R<PCCR45_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PCCR45_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PCCR45_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R... | 30.815385 | 421 | 0.618073 |
715dc837cff2c9b49524deb10cd6d865cd2ca4ba | 15,857 | // Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::helper::{decode_key, gen_keypair, generate_node_name, load_key, save_key};
use crate::{
get_available_port_from, get_random_available_port, parse_key_val, ApiQuotaConfig, BaseConfig,
ConfigModule, QuotaDuration, S... | 33.595339 | 116 | 0.604528 |
fc60c30fcb8cdd0f9ecc0850eb4851047aeb31f4 | 1,726 | #[doc = "Writer for register TASKS_CTSTOP"]
pub type W = crate::W<u32, super::TASKS_CTSTOP>;
#[doc = "Register TASKS_CTSTOP `reset()`'s with value 0"]
impl crate::ResetValue for super::TASKS_CTSTOP {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Stop calibrat... | 26.96875 | 70 | 0.572422 |
9024b5324d6b48768cbb638ae25510f191f78dbf | 3,013 | /// A macro is exposed so that we can embed the program ID.
#[macro_export]
macro_rules! vote_weight_record {
($id:expr) => {
/// Anchor wrapper for the SPL governance program's VoterWeightRecord type.
#[derive(Clone)]
pub struct VoterWeightRecord(spl_governance_addin_api::voter_weight::Vote... | 40.716216 | 99 | 0.563226 |
11f3028fedfa2edeb791b43c1a8ab16f10f1d32f | 186 | use rsip_derives::UntypedHeader;
/// The `Subscription` header in its [untyped](super) form.
#[derive(UntypedHeader, Debug, PartialEq, Eq, Clone)]
pub struct SubscriptionState(String);
| 31 | 59 | 0.763441 |
398e61358aece786cedfbf79a0c146589b12e1d6 | 38,109 | use super::operation::{AddOperation, UserOperation};
use super::segment_updater::SegmentUpdater;
use super::PreparedCommit;
use bit_set::BitSet;
use core::Index;
use core::Segment;
use core::SegmentComponent;
use core::SegmentId;
use core::SegmentMeta;
use core::SegmentReader;
use crossbeam::channel;
use directory::Dir... | 36.190883 | 155 | 0.602456 |
f76a4ce4c89e82a935f75a00424d63470a3d6326 | 203,437 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CancelUpdateStackError {
pub kind: CancelUpdateStackErrorKind,
pub(crate) meta: smithy_types::Error,
}
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CancelUpdateStackE... | 34.91282 | 222 | 0.63603 |
0a27c566c761745accf9c6b40d536f5c3685ac87 | 15,965 | use der_parser::ber::*;
use der_parser::der::*;
use der_parser::error::*;
use der_parser::*;
use hex_literal::hex;
use nom::branch::alt;
use nom::combinator::{complete, eof, map, map_res};
use nom::error::ErrorKind;
use nom::multi::many0;
use nom::sequence::tuple;
use nom::*;
use oid::Oid;
use pretty_assertions::assert... | 36.366743 | 142 | 0.545882 |
ff944e06c81fc83343a23c39bf4f802465c94531 | 3,214 | pub use ruffle_wstr::*;
use std::ops::Deref;
use gc_arena::{Collect, Gc, MutationContext};
use std::borrow::Cow;
#[derive(Clone, Copy, Collect)]
#[collect(no_drop)]
enum Source<'gc> {
Owned(Gc<'gc, OwnedWStr>),
Static(&'static WStr),
}
#[derive(Collect)]
#[collect(require_static)]
struct OwnedWStr(WString);... | 25.712 | 91 | 0.53267 |
e946a6777f595137dbc5eebda3ee634f51c779f1 | 14,808 | // This file is generated by rust-protobuf 2.25.2. 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)]
#!... | 35.090047 | 134 | 0.618922 |
8717e5be390ab3e035537cae3c547e7029d5e43b | 436 | //! Tests auto-converted from "sass-spec/spec/non_conformant/scss-tests/004_test_variables.hrx"
#[test]
fn test() {
assert_eq!(
crate::rsass(
"foo {\
\n $var: 2;\
\n $another-var: 4;\
\n a: $var;\
\n b: $var + $another-var;}\
\n"
... | 19.818182 | 95 | 0.37844 |
6742d6d8d8264d8bb3726308703bca15d19dec0a | 4,717 | // 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::agent::{AgentError, BlueprintHandle, Context, Invocation, Lifespan, Payload};
use crate::base::SettingType;
use crate::message::base::{Audience... | 34.940741 | 100 | 0.59593 |
215e3980761cdabea8e1344dce9a169fcb2fde1c | 734 | pub(crate) mod internal {
pub use std::marker::Unpin;
pub use async_recursion::async_recursion;
pub use futures::io::AsyncBufReadExt;
pub use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, BufReader, BufWriter};
pub use tokio::prelude::*;
pub use crate::*;
}
mod client;
mod ... | 20.388889 | 98 | 0.717984 |
e427f49b4d04dac4bbe4393e72dfd9ea08b7a05f | 3,761 | // Generated from definition io.k8s.api.authorization.v1.NonResourceAttributes
/// NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NonResourceAttributes {
/// Path is the URL path of t... | 36.872549 | 127 | 0.506248 |
5bd1232d4a4af55606971c5300eef48efa415e63 | 1,849 | use crate::*;
pub(crate) fn assert_one_yocto() {
assert_eq!(
env::attached_deposit(),
1,
"Requires attached deposit of exactly 1 yoctoNEAR"
)
}
pub(crate) fn assert_self() {
assert_eq!(
env::predecessor_account_id(),
env::current_account_id(),
"Method is pri... | 29.349206 | 98 | 0.569497 |
765f549ef2f1dd33a06e7205c63318d9a4413600 | 1,015 | /*!
Utilities for suspending the test.
*/
use core::fmt::{Debug, Display};
use core::time::Duration;
use std::thread::sleep;
use tracing::{error, warn};
/**
Call this function in the middle of a test code of interest,
so that we can suspend the test and still interact with the
spawned Gaia chains and chai... | 27.432432 | 111 | 0.614778 |
23e63a8a73909df0c2a568a955ff66c8b10ca299 | 2,411 | use std::io::Error as IoError;
use std::str::Utf8Error;
use std::num::ParseIntError;
use std::fmt::{Display, Formatter};
///读取文件内容
fn _read_file(path: &str) -> std::result::Result<String, std::io::Error> {
std::fs::read_to_string(path)
}
/// 转换为utf8内容
fn _to_utf8(v: &[u8]) -> std::result::Result<&str, std::str::U... | 23.182692 | 74 | 0.577354 |
5b52b1925de9a71a438469d6bded0c528303b5f5 | 2,135 | // Copyright 2017 PingCAP, Inc.
//
// 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 i... | 29.246575 | 84 | 0.635129 |
d7bab851cd5447fd0b0997fc0b06c40642f4368e | 439 | //! This module contains implementations for creating **Comments**, **Overrides**, and **Updates**
//! on a bodhi instance. Creating **Releases** is possible with the REST API, but not implemented
//! yet.
mod traits;
pub(crate) use traits::Create;
mod comments;
pub use comments::{CommentBuilder, NewComment};
mod ov... | 27.4375 | 98 | 0.742597 |
ac16b43fbfa7f105bdc6db2d80607bf6a7da3785 | 78,793 | /*
* Swaggy Jenkins
*
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use crate::apis::ResponseContent;
use super::{Error, configuration};
/... | 51.465056 | 375 | 0.75725 |
f99c2cc5ff9cf8ff851434b903dbfd06836eb07a | 567 | // rustfmt-wrap_comments: true
// rustfmt-max_width: 50
// This example shows how to configure fern to output really nicely colored logs
// - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
// - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
// - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | 47.25 | 94 | 0.802469 |
8a22bc06aceebdc11b0e789f49cbab7206ccf06b | 496 | extern crate libtest;
use serde_json;
use std::io;
use libtest::models::all::required::Assembled;
use libtest::models::idol::ExpandsJson;
fn main() -> Result<(), i32> {
let mut value: serde_json::Value =
serde_json::from_reader(io::stdin()).expect("Invalid json input");
let expanded = Assembled::expand_json... | 22.545455 | 70 | 0.66129 |
d91011d49177a200d8716e4e84f154e364e7dd46 | 16,418 | //! Functions and types for working with CUDA kernels.
use context::{CacheConfig, SharedMemoryConfig};
use cuda_sys::cuda::{self, CUfunction};
use error::{CudaResult, ToResult};
use module::Module;
use std::marker::PhantomData;
use std::mem::transmute;
/// Dimensions of a grid, or the number of thread blocks... | 38.00463 | 141 | 0.594957 |
b95af1609fc018160bf0c4f927f4df88e77a4808 | 819 | use super::File;
use futures::{try_ready, Future, Poll};
use std::fs::OpenOptions as StdOpenOptions;
use std::io;
use std::path::Path;
/// Future returned by `File::open` and resolves to a `File` instance.
#[derive(Debug)]
pub struct OpenFuture<P> {
options: StdOpenOptions,
path: P,
}
impl<P> OpenFuture<P>
wh... | 22.135135 | 83 | 0.620269 |
effe6ecadd27297ecd09d2f5cdba0d86ac32c22e | 18,573 | //! Types used in the rest of the compiler.
use std::sync::Arc;
use std::{rc::Rc, collections::HashMap};
use num::BigInt;
use crate::util::FileSpan;
use crate::elab::{environment::{AtomID, Environment},
lisp::{LispVal, Uncons}};
// /// An argument to a function.
// #[derive(Debug, DeepSizeOf)]
// pub struct Arg {
//... | 33.525271 | 99 | 0.635277 |
4b1fd251d97d67d24ac5d7cbcea5fc955d5576c9 | 930 | use std::ops::Deref;
fn main() {
let m = MyBox::new(String::from("Rust"));
hello(&m);
let c = CustomSmartPointer { data: String::from("my stuff") };
let d = CustomSmartPointer { data: String::from("other stuff") };
println!("CustomSmartPointers created.");
let c = CustomSmartPointer { data: S... | 20.666667 | 75 | 0.591398 |
d6249f19e8eb204eaad15cb5c4d0797d7f687f00 | 13,252 | // Copyright 2020 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... | 33.979487 | 100 | 0.632659 |
0a14cf0bd7b8221757f08766fb7bfd24d7a8eaf4 | 1,905 | pub(crate) mod character_data_seal {
pub trait Seal {
#[doc(hidden)]
fn as_web_sys_character_data(&self) -> &web_sys::CharacterData;
}
}
pub trait CharacterData: character_data_seal::Seal {
fn len(&self) -> u32 {
self.as_web_sys_character_data().length()
}
fn data(&self) ->... | 29.765625 | 76 | 0.592126 |
e5864c57e4e17f016dced275e830d4f0a2d37a17 | 2,907 | use std::path::Path;
use std::io::{Read, Write};
use std::fs::File;
use libc::getuid;
use process_util::env_path_find;
use launcher::Context;
use unshare::{Command, Stdio};
pub struct SystemInfo {
pub expect_inotify_limit: Option<usize>,
}
pub fn check(cinfo: &SystemInfo, context: &Context)
-> Result<(), ... | 32.3 | 78 | 0.492948 |
0a5aa1b7bd34695cebb9a8451c45d0d5e25eb52f | 965 | // 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.125 | 87 | 0.666321 |
5b33a094d18f6c472167380fa33127409f4837fc | 7,892 | // Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
use crate::{aws::Aws, instance::Instance};
use anyhow::{ensure, format_err, Result};
use config_builder::ValidatorConfig;
use generate_keypair::load_key_from_file;
use libra_config::config::AdmissionControlConf... | 35.710407 | 98 | 0.538267 |
f916cd7396282b3c83994915d72b8092ef1d31c5 | 86 | #[derive(Debug, Clone)]
pub enum CowRef<'a, T> {
Ref(&'a T),
Boxed(Box<T>),
}
| 14.333333 | 24 | 0.523256 |
db623a6570fc04cc02068fea4ef86e6e19fc726e | 14,020 | //
// Copyright 2017 hasselc Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://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... | 39.716714 | 116 | 0.498859 |
f402fab5cacdc07f819167084100d9a936586990 | 12,396 | use crate::core::{InternedString, PackageId, SourceId};
use crate::sources::git;
use crate::sources::registry::MaybeLock;
use crate::sources::registry::{RegistryConfig, RegistryData, CRATE_TEMPLATE, VERSION_TEMPLATE};
use crate::util::errors::{CargoResult, CargoResultExt};
use crate::util::{Config, Filesystem, Sha256};... | 37.677812 | 95 | 0.56131 |
28916f0adf6a0de569c3c68dbc5ec401258524a4 | 532 | use rand;
use rand::distributions::{Distribution, Standard};
use {Address, AddressBusIO, Data};
#[derive(Default)]
pub struct Random<T: Data> {
value: T,
}
impl<T: Data> Random<T> {
pub fn new() -> Random<T> {
Random { value: T::zero() }
}
}
impl<T: Address, U: Data> AddressBusIO<T, U> for Random... | 19 | 58 | 0.578947 |
9b61aa4bca7883b447c3372d9e08771dec81ab46 | 20,844 | use crate::blob::generate_blob_uri;
use crate::blob::responses::PutBlobResponse;
use azure_sdk_storage_core::client::Client;
use azure_sdk_storage_core::ClientRequired;
use azure_sdk_core::errors::{check_status_extract_headers_and_body, AzureError};
use azure_sdk_core::headers::BLOB_TYPE;
use azure_sdk_core::lease::Lea... | 34.74 | 137 | 0.660814 |
7af0c57a0e58d2247b76e108422be29520516acc | 7,938 | use super::*;
use crate::types::BalanceOf;
use bitcoin::{
formatter::{Formattable, TryFormattable},
types::{
BlockBuilder, H256Le, RawBlockHeader, TransactionBuilder, TransactionInputBuilder, TransactionInputSource,
TransactionOutput,
},
};
use btc_relay::{BtcAddress, BtcPublicKey, Pallet as... | 41.778947 | 147 | 0.597002 |
23a6e54e0a174b92d6b9b6ca6fff5e1204347195 | 583 | // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use crate::engine::KvEngine;
use crate::iterable::Iterable;
use crate::peekable::Peekable;
use std::fmt::Debug;
use std::ops::Deref;
pub trait Snapshot<E>
where
Self: 'static + Peekable + Iterable + Send + Sync + Sized + Debug,
E: KvEngine,
{
... | 20.821429 | 70 | 0.662093 |
1a037f3a0ebe854f18cfade0451fa7019f8d6f08 | 17,770 | use std::{collections::BTreeSet, iter::FromIterator};
use assert_matches::assert_matches;
use once_cell::sync::Lazy;
use casper_engine_test_support::{
DeployItemBuilder, ExecuteRequestBuilder, InMemoryWasmTestBuilder, DEFAULT_ACCOUNT_ADDR,
DEFAULT_PAYMENT, DEFAULT_RUN_GENESIS_REQUEST,
};
use casper_execution_... | 34.774951 | 95 | 0.630051 |
f502cfa43ff76440352c80ad5985ffbf1abaf34b | 106 | pub mod contract;
pub mod state;
mod global;
mod math;
mod querier;
mod user;
#[cfg(test)]
mod testing;
| 9.636364 | 17 | 0.707547 |
ef6d13534651760d7f1684d8484b02e98ddd53dc | 2,401 | use crate::util::{print_part_1, print_part_2};
use std::collections::HashSet;
use std::fs::read_to_string;
use std::time::Instant;
fn santa_travel(input: &str, part: usize) -> usize {
let mut santa_index = 0;
let mut coll = HashSet::new();
let mut x = [0, 0];
let mut y = [0, 0];
coll.insert((x[san... | 23.772277 | 79 | 0.502291 |
1afb3728c9d72e7d00d20a153631a312b72302e6 | 17,621 | // 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... | 32.096539 | 87 | 0.508654 |
f9d1a1fe2886ff20af6d97ffa3dddb2535835b7f | 377 | // Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
pub use auto_save::OptionAutoSave;
pub use auto_save::WasmAutoSave;
pub use identity_setup::WasmIdentitySetup;
pub use key_location::WasmKeyLocation;
pub use method_content::*;
pub use signature::WasmSignature;
mod auto_save;
mod identity_set... | 23.5625 | 42 | 0.809019 |
e5dc4b71daaf5873bb0758fccccf826ba29ee091 | 5,481 | // Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 or BSD-3-Clause
//
// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is gove... | 40.301471 | 98 | 0.678708 |
ff59c7ea7617a563fc51b5b5692cc80137be391a | 54,258 | use regex::Regex;
#[derive(Clone, Debug, PartialEq)]
pub enum Token {
Address,
AndEquals,
Anonymous,
Arrow,
As,
Assembly,
Assignment,
ASMAssign,
BitwiseAnd,
BitwiseOr,
BitwiseXor,
Bool,
Break,
Byte,
Bytes,
Bytes1,
Bytes2,
Bytes3,
Bytes4,
B... | 25.061432 | 102 | 0.500313 |
2f5e7d367242aeb471d1aadabed68716322ee18a | 47,120 | #![allow(unused_imports, non_camel_case_types)]
use crate::models::r5::Annotation::Annotation;
use crate::models::r5::Attachment::Attachment;
use crate::models::r5::CodeableConcept::CodeableConcept;
use crate::models::r5::Element::Element;
use crate::models::r5::Extension::Extension;
use crate::models::r5::Identifier:... | 35.007429 | 100 | 0.546923 |
b97d5833224aef820dc156ed2b639b180918ca46 | 4,071 | use std::io::{self, Write};
use std::mem::size_of;
use bytemuck::bytes_of;
use crate::internal::align_offset;
use crate::std140::{AsStd140, Std140, WriteStd140};
/**
Type that enables writing correctly aligned `std140` values to a buffer.
`Writer` is useful when many values need to be laid out in a row that cannot ... | 25.285714 | 80 | 0.610661 |
bbe80136340c29cee961227ef39fd59bc18fefd3 | 43 | mod a;
mod b;
pub use self::{a::*, b::*};
| 8.6 | 27 | 0.465116 |
cca353a1d5e625f0e6fbfa3b3b0b2938d4da9492 | 3,662 | use crate::{
render_resource::{Texture, TextureView},
renderer::RenderDevice,
};
use bevy_ecs::prelude::ResMut;
use bevy_utils::HashMap;
use wgpu::{TextureDescriptor, TextureViewDescriptor};
/// The internal representation of a [`CachedTexture`] used to track whether it was recently used
/// and is currently t... | 36.257426 | 97 | 0.575369 |
1860e7a228ff0835b6b6f28a997e634ade07b683 | 935 | // Copyright 2020-2021 The Datafuse Authors.
//
// SPDX-License-Identifier: Apache-2.0.
#[tokio::test]
async fn test_drop_database_interpreter() -> anyhow::Result<()> {
use common_planners::*;
use futures::TryStreamExt;
use pretty_assertions::assert_eq;
use crate::interpreters::*;
use crate::sql::... | 30.16129 | 80 | 0.640642 |
d948dc552cdbcab874b9b4a2e41be150c1e0e02a | 301 | // @has variant_tuple_struct.json "$.index[*][?(@.name=='EnumTupleStruct')].visibility" \"public\"
// @has - "$.index[*][?(@.name=='EnumTupleStruct')].kind" \"enum\"
pub enum EnumTupleStruct {
// @has - "$.index[*][?(@.name=='VariantA')].inner.variant_kind" \"tuple\"
VariantA(u32, String),
}
| 43 | 98 | 0.607973 |
ab4dd810e049e1dcb725325c67f07fb3f20ec886 | 1,755 | use core::{ops::Deref, ptr::NonNull};
/// Describes a physical mapping created by `AcpiHandler::map_physical_region` and unmapped by
/// `AcpiHandler::unmap_physical_region`. The region mapped must be at least `size_of::<T>()`
/// bytes, but may be bigger.
pub struct PhysicalMapping<T> {
pub physical_start: usize,... | 48.75 | 101 | 0.709972 |
f759ec0d043701a59ce9f51730ea63080c7ad5b8 | 88,947 | //! Tock default Process implementation.
//!
//! `ProcessStandard` is an implementation for a userspace process running on
//! the Tock kernel.
use core::cell::Cell;
use core::cmp;
use core::fmt::Write;
use core::ptr::NonNull;
use core::{mem, ptr, slice, str};
use crate::collections::queue::Queue;
use crate::collecti... | 41.389949 | 223 | 0.562088 |
902f2c72409ef8b8ceda31ecb8d6eb764ef491ae | 3,601 | // 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 ... | 23.383117 | 97 | 0.546515 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.