text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
use std::collections::HashMap; pub fn unescape_hex(string: &str) -> String { let mut ret = "".to_owned(); let mut chars = string.chars(); let mut peekable = DoublePeek::new(&mut chars); while let Some(val) = peekable.next() { if val != '%' { ret.push(val); } else { ...
the_stack
use gtk::prelude::*; use gtk::{Bin, EventControllerKey, TreeView}; use crate::fl; use crate::help_functions::get_custom_label_from_button_with_image; use crate::notebook_enums::NotebookUpperEnum; #[derive(Clone)] pub struct GuiUpperNotebook { pub notebook_upper: gtk::Notebook, pub scrolled_window_included_di...
the_stack
use crate::dynamics::{CoefficientCombineRule, MassProperties, RigidBodyHandle, RigidBodyType}; use crate::geometry::{InteractionGroups, SAPProxyIndex, Shape, SharedShape}; use crate::math::{Isometry, Real}; use crate::parry::partitioning::IndexedData; use crate::pipeline::{ActiveEvents, ActiveHooks}; use std::ops::{Der...
the_stack
use std::cell::{Cell, RefCell}; use std::collections::HashMap; use std::io::{Error, ErrorKind}; use std::rc::Rc; use sulis_core::config::Config; use sulis_core::io::{GraphicsRenderer}; use sulis_core::util::{invalid_data_error, ExtInt, Offset, Point, Scale}; use sulis_module::on_trigger::QuestEntryState; use sulis_mod...
the_stack
use crate::structs::kong::Kong; use std::{collections::BTreeMap, env}; use regex::Regex; use semver::Version; use url::Url; use uuid::Uuid; #[allow(unused_imports)] use super::{BaseManifest, ConfigState, Result, Vault}; use super::structs::Authorization; /// Versioning Scheme used in region /// /// This is valdia...
the_stack
use crate::name::Name; use crate::predicates::*; use crate::types::{FPType, NamedStructDef, Type, TypeRef, Typed, Types}; use std::convert::TryFrom; use std::fmt::{self, Display}; use std::ops::Deref; use std::sync::Arc; /// See [LLVM 12 docs on Constants](https://releases.llvm.org/13.0.0/docs/LangRef.html#constants)....
the_stack
use crate::geometry::{LineSegment, Point, Trapezoid}; use crate::internal_iter::InternalIterator; use crate::path::{LinePathCommand, LinePathIterator}; use std::cmp::Ordering; use std::collections::BinaryHeap; use std::mem; use std::ops::Range; /// Converts a sequence of line path commands to a sequence of trapezoids....
the_stack
use std::{collections::HashMap, convert::TryInto, num::TryFromIntError, time::Instant}; use crypto::blake2b::{self, Blake2bError}; use redux_rs::{ActionWithMeta, Store}; use slog::debug; use storage::{cycle_storage::CycleData, num_from_slice}; use tezos_messages::base::{ signature_public_key::{SignaturePublicKey, ...
the_stack
use chalk_integration::query::LoweringDatabase; #[test] fn well_formed_trait_decl() { lowering_success! { program { trait Clone { } trait Copy where Self: Clone { } struct Foo { } impl Clone for Foo { } impl Copy for Foo { } } } } #...
the_stack
use crate::aabb::{Bounded, AABB}; use crate::bounding_hierarchy::{BHShape, BoundingHierarchy}; use crate::bvh::iter::BVHTraverseIterator; use crate::ray::Ray; use crate::utils::{concatenate_vectors, joint_aabb_of_shapes, Bucket}; use crate::Point3; use crate::EPSILON; use std::f32; /// The [`BVHNode`] enum that descri...
the_stack
use std::{collections::HashMap, path::PathBuf, sync::Arc}; use persia_libs::{ indexmap, once_cell::sync::OnceCell, serde::{self, Deserialize, Serialize}, serde_yaml, thiserror::Error, tracing, }; use persia_speedy::{Readable, Writable}; #[derive(Readable, Writable, Error, Debug, Clone)] pub e...
the_stack
use std::cmp; use std::fmt; use std::ops; use std::slice; #[derive(Debug, Copy, Clone)] #[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] /// The upper bound for each `Histogram` bins. The user is responsible for /// determining effective bins for their use-case. pub enum Bound<T> where T: Cop...
the_stack
#[allow(unused_imports)] use super::super::assert_eq; use TestPPU; #[inline(never)] pub fn test_vram_access_during_sprite_rendering_double_height( ppu: &mut TestPPU ) { assert_eq!( ppu.scanline(), 261 ); assert_eq!( ppu.dot(), 0 ); for i in 0..4096u32 { ppu.write_vram( i as u16, (i + 0x80) as u8 );...
the_stack
use super::*; use anyhow::Result; use std::{ collections::{BTreeMap, BTreeSet}, path::Path, }; use tangram_progress_counter::ProgressCounter; use tangram_zip::zip; #[derive(Clone)] pub struct FromCsvOptions<'a> { pub column_types: Option<BTreeMap<String, TableColumnType>>, pub infer_options: InferOptions, pub inv...
the_stack
//! This crate defines a collection of useful utilities for testing rust code. use std::sync::Mutex; /// Asserts that the first argument is strictly less than the second. #[macro_export] macro_rules! assert_lt { ($x:expr, $y:expr) => { assert!( $x < $y, "assertion `{} < {}` failed;...
the_stack
use std::collections::HashMap; use std::ffi::OsString; use std::str::FromStr; use gtk4::glib::clone; use gtk4::subclass::prelude::*; use gtk4::{self, gio, prelude::*}; use gtk4::{glib, CompositeTemplate}; use gtk_macros::action; use log::{debug, error, warn}; use engine::EpicEngine; use version_compare::Cmp; pub mod...
the_stack
use alloc::collections::btree_map::BTreeMap; use core::ops::Bound::*; use alloc::vec::Vec; use core::cmp::*; use core::ops::Deref; use super::mutex::*; use super::addr::*; use super::common::{Error, Result}; pub const MAX_RANGE : u64 = core::u64::MAX; #[derive(Copy, Clone, Default, Debug)] pub struct Range { pub...
the_stack
mutable_transmutes, non_camel_case_types, non_snake_case, non_upper_case_globals )] use super::dpx_sfnt::{sfnt_find_table_pos, sfnt_open, sfnt_read_table_directory}; use crate::{info, warn}; use std::rc::Rc; use super::dpx_cff::{ cff_add_string, cff_charsets_lookup, cff_charsets_lookup_inverse, cff_en...
the_stack
use bevy::{prelude::*, reflect::TypeRegistry}; use ggrs::{ GGRSError, GGRSRequest, GameInput, GameState, GameStateCell, P2PSession, P2PSpectatorSession, PlayerHandle, SessionState, SyncTestSession, }; use instant::{Duration, Instant}; use crate::{world_snapshot::WorldSnapshot, SessionType}; /// Marker resourc...
the_stack
use std::ops::Range; use crate::list::{encoding, ListCRDT, Time, ROOT_TIME}; use crate::list::encoding::{Chunk, Parents, Run, SpanWriter}; use crate::list::positional::InsDelTag; use crate::rangeextra::OrderRange; use crate::rle::{KVPair, RleSpanHelpers, RleVec}; use crate::list::encoding::varint::{num_encode_i64_with...
the_stack
use num::{Integer, NumCast, Unsigned}; use std::cmp; use std::collections::HashMap; use std::fmt::Debug; use std::hash::Hash; use std::marker::PhantomData; use theon::adjunct::Map; use typenum::NonZero; use crate::constant::{Constant, ToType, TypeOf}; use crate::primitive::decompose::IntoVertices; use crate::primitive...
the_stack
use std::collections::{BTreeMap, BTreeSet}; use std::path::Path; use std::process::Command; use serde::{Deserialize, Serialize}; /// If this is `true` then the output file we generate will not emit any /// unsafe code. I'm not aware of any bugs with the unsafe code that I use and /// thus this is by default set to `fa...
the_stack
//! The types in this module make up the structure of the configuration-file(s). //! //! # Example //! //! The following is an examplary TOML configuration, which will be parsed into this modules types. //! //! ``` //! # use dfw::nftables::Nftables; //! # use dfw::types::*; //! # use toml; //! # toml::from_str::<DFW<Nf...
the_stack
use std::collections::HashMap; use crate::common::span::Spanned; use crate::compiler::{ cst::{CST, CSTPattern}, sst::{SST, SSTPattern, UniqueSymbol, Scope}, syntax::Syntax, }; // TODO: hoisting before expansion. // TODO: hoist labels? how are labels declared? types? // TODO: once modules exist, the entire...
the_stack
use crate::error; use crate::repr::HIR; use crate::runtime_defs; use super::top_level::compile_top_level_hirs; use inkwell::basic_block::BasicBlock; use inkwell::builder::Builder; use inkwell::context::Context; use inkwell::execution_engine::{ExecutionEngine, JitFunction}; use inkwell::module::Module; use inkwell::pa...
the_stack
use { crate::{ error::{listing, throw, Error}, format::CodeStr, parser::parse, schema, tokenizer::tokenize, }, std::{ borrow::ToOwned, collections::{BTreeMap, HashSet}, fs::read_to_string, io::{self, ErrorKind}, path::PathBuf, ...
the_stack
use crate::config::{ChartColors, ChartConfig, DARK_CHART_COLORS, LIGHT_CHART_COLORS}; use num::ToPrimitive; use std::{cell::RefCell, rc::Rc}; use wasm_bindgen::{prelude::*, JsCast}; use web_sys as dom; pub struct Chart<T> where T: ChartImpl, { active_hover_regions: Vec<ActiveHoverRegion<T::HoverRegionInfo>>, chart_...
the_stack
use { crate::{ exceptions::ZstdError, stream::{make_in_buffer_source, InBufferSource}, zstd_safe::CCtx, }, pyo3::{ buffer::PyBuffer, exceptions::{PyOSError, PyValueError}, prelude::*, types::{PyBytes, PyList}, PyIterProtocol, }, std::sy...
the_stack
use std::default::Default; use std::ffi::CString; use std::io::Cursor; use std::mem; use ash::util::*; use ash::{vk, Device}; use crate::minivector::*; use crate::vulkan_base::*; use crate::vulkan_helpers::*; #[derive(Clone, Copy)] pub struct VisibilityData { pub index: u32, } #[derive(Clone, Copy)] pub struct ...
the_stack
use crate::image_view::BstImageView; use crate::{misc, Basalt}; use crossbeam::deque::{Injector, Steal}; use crossbeam::sync::{Parker, Unparker}; use ilmenite::{ImtImageView, ImtWeight}; use image::{self, GenericImageView}; use ordered_float::OrderedFloat; use parking_lot::{Condvar, Mutex}; use std::collections::HashMa...
the_stack
use conch_parser::ast::builder::*; use conch_parser::parse::ParseError::*; use conch_parser::token::Token; mod parse_support; use crate::parse_support::*; #[test] fn test_case_command_valid() { let correct = CaseFragments { word: word("foo"), post_word_comments: vec![], in_comment: None, ...
the_stack
use std::collections::HashMap; use std::fmt::Write; use rustc::hir::def_id::DefId; use rustc::mir::interpret::ConstValue; use rustc::mir; use rustc::ty::layout::{self, Size, HasDataLayout, LayoutOf, TyLayout}; use rustc::ty::subst::{Subst, Substs, Kind}; use rustc::ty::{self, Ty, TyCtxt, TypeFoldable, Binder}; use rus...
the_stack
/// ```sh /// cargo watch -x "test -- --test-threads=1" /// ``` extern crate micro_judge; use core_model::*; use micro_judge::io::{redis_keys, stream, topics}; use micro_judge::repo::game_states::GameStatesRepo; use move_model::*; use redis::Commands; use redis_keys::RedisKeyNamespace; use std::panic; use std::rc::Rc;...
the_stack
use errors::{DeliveryError, Kind}; use std::convert::AsRef; use std::env; use std::fs; use std::fs::File; use std::io; use std::io::prelude::*; use std::path::{Path, PathBuf}; use std::process; use std::process::Output as CmdOutput; use types::DeliveryResult; use utils::path_join_many::PathJoinMany; pub mod open; pub ...
the_stack
use std::collections::HashSet; use std::hash::{Hash, Hasher}; use std::ops::Range; use crate::{Angle, Bond, BondDistances, Dihedral}; use crate::Array2; /// The basic building block for a topology. A `Bonding` contains data about /// the connectivity (bonds, angles, dihedrals) between particles in a single /// molec...
the_stack
use lazy_static::lazy_static; use std::collections::hash_map::{Entry, HashMap}; use std::sync::Mutex; use libR_sys::{ R_NilValue, R_PreserveObject, R_ReleaseObject, R_xlen_t, Rf_allocVector, LENGTH, SET_VECTOR_ELT, SEXP, VECSXP, VECTOR_ELT, }; lazy_static! { static ref OWNERSHIP: Mutex<Ownership> = Mutex:...
the_stack
use super::handle_error::handle_error_and_exit; use crate::classes::local_package_info::LocalPackageInfo; use colored::Colorize; pub fn check_installed(display_name: String) -> bool { use winreg::enums::*; use winreg::RegKey; let mut regkey = RegKey::predef(HKEY_LOCAL_MACHINE); let mut exists: bool =...
the_stack
use std::{cmp::Ordering, io, ops::Range, str}; use bytes::{Buf, BufMut, Bytes, BytesMut}; use thiserror::Error; use crate::{ coding::{self, BufExt, BufMutExt}, crypto, ConnectionId, }; // Due to packet number encryption, it is impossible to fully decode a header // (which includes a variable-length packet nu...
the_stack
use crate::prelude::*; use lazy_static::lazy_static; use rayon::prelude::*; use regex::Regex; use serde::{de, Deserialize, Deserializer}; use html5ever::tendril::TendrilSink; use html5ever::*; use markup5ever_rcdom::{Handle, NodeData, RcDom}; lazy_static! { /// a regex that matches a search match in the response ...
the_stack
#![stable(feature = "pin", since = "1.33.0")] use crate::cmp::{self, PartialEq, PartialOrd}; use crate::fmt; use crate::hash::{Hash, Hasher}; use crate::marker::{Sized, Unpin}; use crate::ops::{CoerceUnsized, Deref, DerefMut, DispatchFromDyn, Receiver}; /// A pinned pointer. /// /// This is a wrapper around a kind of...
the_stack
//! Image views. //! //! This module contains types related to image views. An image view wraps around //! an image and describes how the GPU should interpret the data. It is needed when an image is //! to be used in a shader descriptor or as a framebuffer attachment. use crate::check_errors; use crate::device::Device...
the_stack
pub mod utils; use anchor_lang::AccountDeserialize; use mpl_auction_house::{pda::*, AuctionHouse}; use mpl_testing_utils::{ assert_error, solana::{airdrop, create_associated_token_account, create_mint}, }; use solana_program_test::*; use solana_sdk::{ instruction::InstructionError, signature::Keypair, sign...
the_stack
use crate::anchors::{OwnedTrustAnchor, RootCertStore}; use crate::client::ServerName; use crate::error::Error; use crate::key::Certificate; #[cfg(feature = "logging")] use crate::log::{debug, trace, warn}; use crate::msgs::enums::SignatureScheme; use crate::msgs::handshake::{DigitallySignedStruct, DistinguishedNames}; ...
the_stack
use std::convert::Into; use std::char; use std::io::{self, Read}; use byteorder::{ReadBytesExt, BigEndian}; use rustc_serialize::Decoder as RustcDecoder; use {Type, CborResult, CborError, ReadError}; /// Experimental and incomplete direct decoder. /// /// **WARNING:** Do not use this to decode CBOR data that you don...
the_stack
use crate::bounding_volume::AABB; use crate::math::{Point, Real, Vector, DIM}; use crate::query; use crate::transformation::voxelization::{Voxel, VoxelSet}; use std::sync::Arc; /// Controls how the voxelization determines which voxel needs /// to be considered empty, and which ones will be considered full. #[derive(Co...
the_stack
use crate::errors::prelude::*; use crate::keys::prelude::*; use crate::{ multi_scalar_mul_const_time_g1, multi_scalar_mul_var_time_g1, rand_non_zero_fr, Commitment, RandomElem, SignatureBlinding, SignatureMessage, FR_COMPRESSED_SIZE, G1_COMPRESSED_SIZE, G1_UNCOMPRESSED_SIZE, }; use ff_zeroize::{Field, Prime...
the_stack
use crate::bytecode_encoder::encode_v1::{RawCondition, RawInstruction, RawOp}; use crate::compiler; use crate::compiler::instruction::{DeviceProperty, RawAstLocation}; use crate::ddk_bind_constants::{BIND_AUTOBIND, BIND_FLAGS, BIND_PROTOCOL}; use crate::errors::UserError; use num_traits::FromPrimitive; use std::collect...
the_stack
use super::{ lovense_dongle_messages::{ LovenseDeviceCommand, LovenseDongleIncomingMessage, OutgoingLovenseData, }, lovense_dongle_state_machine::create_lovense_dongle_machine, }; use crate::{ core::ButtplugResultFuture, server::comm_managers::{ DeviceCommunicationEvent, DeviceCommunicatio...
the_stack
use crate::{Axis3, Morton3}; use super::{point_traits::*, Point2, PointN}; use core::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Not, Range, Rem, Shl, Shr, Sub}; use itertools::{iproduct, ConsTuples, Product}; use num::{traits::Pow, Integer, Signed}; use std::cmp::Ordering; /// A 3-dimensional point with scalar type...
the_stack
use crate::convert::{TryFrom, TryInto}; use crate::fmt; use crate::io; use crate::mem; use crate::num::{NonZeroI32, NonZeroI64}; use crate::ptr; use crate::sys::process::process_common::*; use crate::sys::process::zircon::{zx_handle_t, Handle}; use libc::{c_int, size_t}; /////////////////////////////////////////////...
the_stack
//! Handles argument parsing. //! //! # Example //! //! ``` //! # use crosvm::argument::{Argument, Error, print_help, set_arguments}; //! # let args: std::slice::Iter<String> = [].iter(); //! let arguments = &[ //! Argument::positional("FILES", "files to operate on"), //! Argument::short_value('p', "program", "...
the_stack
use itertools::Itertools; use crate::common::Color; use crate::common::Rect; use crate::components::background::Background; use crate::frame::Frame; use crate::framework::context::Context; use crate::framework::error::GameResult; use crate::framework::filesystem; use crate::input::combined_menu_controller::CombinedMen...
the_stack
use gumdrop::Options; use httpmock::{Method::GET, Mock, MockServer}; use std::io::{Read, Write}; use std::net::TcpStream; use std::{str, time}; use tokio_tungstenite::tungstenite::Message; use goose::config::GooseConfiguration; use goose::controller::{ GooseControllerCommand, GooseControllerWebSocketRequest, Goose...
the_stack
use std::boxed::Box; use std::vec::Vec; use crate::limits::{ MAX_WASM_FUNCTIONS, MAX_WASM_FUNCTION_LOCALS, MAX_WASM_STRING_SIZE, MAX_WASM_TABLE_ENTRIES, }; use crate::primitives::{ BinaryReaderError, CustomSectionKind, ExternalKind, FuncType, GlobalType, ImportSectionEntryType, LinkingType, MemoryType, Na...
the_stack
use std::{ collections::HashMap, path::{Path, PathBuf}, sync::Arc, time::Duration, }; use arci::{ BaseVelocity, Error as ArciError, JointTrajectoryClient, JointTrajectoryClientsContainer, Localization, MoveBase, Navigation, Speaker, WaitFuture, }; use k::{nalgebra::Isometry2, Chain, Isometry3};...
the_stack
mod api; use api::*; use num_traits::*; use xous::CID; use xous_ipc::Buffer; use log::info; #[derive(Copy, Clone, Debug)] struct ScalarCallback { server_to_cb_cid: CID, cb_to_client_cid: CID, cb_to_client_id: u32, } #[cfg(any(target_os = "none", target_os = "xous"))] mod implementation { use crate::...
the_stack
// https://github.com/rust-lang/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy::all)] #![allow(unused_attributes)] #![rustfmt::skip] #![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(non_upper_case_globals)] #![allo...
the_stack
use std::{fs::File, io::Read, path::Path}; use log::{trace, warn}; use crate::{matcher::Matcher, Bitness, Info, Type, Version}; pub fn get() -> Option<Info> { retrieve(&DISTRIBUTIONS) } fn retrieve(distributions: &[ReleaseInfo]) -> Option<Info> { for release_info in distributions { if !Path::new(rel...
the_stack
#![cfg_attr(all(feature = "benchmarks", test), feature(test))] #[cfg(all(test, feature = "benchmarks"))] extern crate test as test_std; #[cfg(test)] extern crate flate2; // #[cfg(test)] // extern crate inflate; extern crate adler32; extern crate byteorder; #[cfg(feature = "gzip")] extern crate gzip_header; mod comp...
the_stack
use std::cmp::max; use std::collections::{BTreeMap, HashMap}; use std::ops::Index; use daggy::{Dag, EdgeIndex, NodeIndex, Walker}; use crate::core::operator::DEFAULT_PARALLELISM; use crate::core::runtime::{JobId, OperatorId}; use crate::dag::stream_graph::{StreamGraph, StreamNode}; use crate::dag::{DagError, Operator...
the_stack
use crate::prelude::*; use rome_formatter::{format_args, write, Buffer, VecBuffer}; use rome_js_syntax::{ JsAnyExpression, JsAnyInProperty, JsBinaryExpression, JsBinaryOperator, JsInExpression, JsInstanceofExpression, JsLanguage, JsLogicalExpression, JsLogicalOperator, JsPrivateName, JsSyntaxKind, JsSyntax...
the_stack
use serde::{de::Error as _, Deserialize, Serialize}; #[cfg(test)] use serde_json::json; use std::{ collections::{HashMap, HashSet}, fmt, }; use crate::{common::*, drivers::dbcrossbar_schema::external_schema::ExternalSchema}; /// Information about about a table and any supporting types. This is the "top /// le...
the_stack
use { crate::{error::EventsRoutingError, walk_state::WalkStateUnit}, cm_rust::{CapabilityName, DictionaryValue, EventMode}, maplit::hashmap, std::collections::HashMap, }; #[derive(Debug)] pub struct EventSubscription { pub event_name: CapabilityName, /// Determines whether component manager wai...
the_stack
// 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)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(non_upper_cas...
the_stack
#[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, )] pub enum SupportDataSetType { #[allow(missing_docs)] // documentation missi...
the_stack
use super::{ akm::{self, AKM_PSK, AKM_SAE}, cipher::{self, CIPHER_CCMP_128}, pmkid, suite_filter::DEFAULT_GROUP_MGMT_CIPHER, suite_selector, }; use crate::appendable::{Appendable, BufferTooSmall}; use crate::organization::Oui; use bytes::Bytes; use nom::combinator::{map, map_res}; use nom::number::...
the_stack
use crate::ast::{Expr, FnCallExpr, Ident, OpAssignment, Stmt, AST_OPTION_FLAGS::*}; use crate::custom_syntax::CustomSyntax; use crate::func::{ get_hasher, native::{OnDebugCallback, OnParseTokenCallback, OnPrintCallback, OnVarCallback}, CallableFunction, IteratorFn, }; use crate::module::NamespaceRef; use cr...
the_stack
extern crate searchspot; extern crate rs_es; extern crate chrono; extern crate params; extern crate serde_json; #[macro_use] extern crate lazy_static; extern crate urlencoded; extern crate url; use helpers::{make_client, refresh_index, parse_query}; use searchspot::resources::{Talent, FoundTalent, SearchResults}; use...
the_stack
use std::cmp; use std::convert::From; use std::fs::{File, OpenOptions}; use std::io::{self, Seek, SeekFrom, Write}; use std::os::linux::fs::MetadataExt; use std::path::PathBuf; use std::result; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; use logger::{error, warn}; use utils::eventfd::E...
the_stack
mod cmdtest { #[test] fn test_character_range_error_c() { let mut cmd = assert_cmd::Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap(); cmd.args(&["-c", "2-1"]) .write_stdin("test\n") .assert() .code(1); } #[test] fn test_line() { let mut...
the_stack
use super::code_formatting; use super::http_message_parser; use super::http_message_parser::{HttpBody, HttpRequestResponseData}; use crate::widgets::win; use crate::BgFunc; use gdk_pixbuf::prelude::*; use gtk::prelude::*; use relm::Widget; use relm_derive::{widget, Msg}; use std::borrow::Cow; use std::sync::mpsc; cons...
the_stack
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::hash::BuildHasher; use std::ops::Deref; use std::sync::Arc; pub use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt}; pub use num::{FromPrimitive, ToPrimitive}; use thiserror::Error; pub use crate::types::uvar; #[cfg(feature = "bitv...
the_stack
#![allow(dead_code)] #![allow(non_snake_case)] #![allow(non_upper_case_globals)] #![allow(nonstandard_style)] #![allow(unused_imports)] #![allow(unused_mut)] use super::simplelrlistener::*; use antlr_rust::atn::{ATN, INVALID_ALT}; use antlr_rust::atn_deserializer::ATNDeserializer; use antlr_rust::dfa::DFA; use antlr_ru...
the_stack
#![deny(missing_docs)] //! Asynchronous generator-like functionality in stable Rust. use { futures::{ channel::mpsc, future::FusedFuture, prelude::*, stream::FusedStream, task::{Context, Poll}, }, pin_project::pin_project, std::pin::Pin, }; /// Produces an asyn...
the_stack
use super::vm_value::{to_value, Value}; use crate::error::{Result, Wrap}; use crate::ffi::{ unqlite_array_add_strkey_elem, unqlite_compile, unqlite_compile_file, unqlite_value, unqlite_value_bool, unqlite_value_double, unqlite_value_int64, unqlite_value_null, unqlite_value_string, unqlite_vm, unqlite_vm_con...
the_stack
use serde_json::value::Value; use result::Result; use error::*; use ty::*; trait OkType<T> { fn ok_type(self, &'static str, Ty) -> Result<T>; } impl<T> OkType<T> for Option<T> { fn ok_type(self, expected: &'static str, actual: Ty) -> Result<T> { match self { Some(v) => Ok(v), N...
the_stack
use crate::{ bytes::{Bytes, FillBytes}, conn::{Connection, MountOptions}, decoder::Decoder, op::{DecodeError, Operation}, }; use polyfuse_kernel::*; use std::{ cmp, convert::{TryFrom, TryInto as _}, ffi::OsStr, fmt, io::{self, prelude::*, IoSlice, IoSliceMut}, mem::{self, MaybeUn...
the_stack
use crate::raftpb::raft::{Entry, Snapshot}; // unstable.entries[i] has raft log position i+unstable.offset. // Note that unstable.offset may be less than highest log // position in storage; this means that the next write to storage // might need to truncate the log before persisting unstable.entries. #[derive(Default,...
the_stack
// todo: Merge this with the other i2c module? // Based on `stm32f4xx-hal`. use core::ops::Deref; use cortex_m::interrupt::free; #[cfg(feature = "embedded-hal")] use embedded_hal::blocking::i2c::{Read, Write, WriteRead}; use crate::{ clocks::Clocks, pac::{self, i2c1, RCC}, rcc_en_reset, }; use paste::...
the_stack
use std::cell::RefCell; use std::collections::HashMap; use std::io::Error; use std::rc::Rc; use rlua::{self, Context, UserData, UserDataMethods}; use crate::script::{Result, ScriptActiveSurface, ScriptEntity}; use crate::{ is_threat, is_within, is_within_attack_dist, is_within_touch_dist, EntityState, GameState, ...
the_stack
use crate::collection::IndexingPolicy; use crate::collection::PartitionKey; use crate::prelude::*; use crate::responses::CreateCollectionResponse; use azure_sdk_core::errors::{check_status_extract_headers_and_body, AzureError}; use azure_sdk_core::prelude::*; use azure_sdk_core::{No, ToAssign, Yes}; use hyper::StatusCo...
the_stack
use anyhow::Context; use rusqlite::{named_params, params, Connection, OptionalExtension, Transaction}; use stark_hash::StarkHash; use web3::types::H256; use crate::{ core::{ ClassHash, ContractAddress, ContractRoot, ContractStateHash, EthereumBlockHash, EthereumBlockNumber, EthereumLogIndex, Ethere...
the_stack
use std::collections::hash_map::Entry; use std::collections::HashMap; use parity_wasm::elements::Instruction; use crate::cfg::{BlockBuilder, BlockRef, Jump}; use super::{ Block, BlockNum, Cont, ContKind, Depth, DepthUnresolvedCont, Edge, Op, UnresolvedJump, CFG, }; /// Used to build `CFG` /// /// The entry poin...
the_stack
use super::storage_api::*; use ::desync::*; use futures::prelude::*; use futures::future; use std::i64; use std::sync::*; use std::time::{Duration}; use std::collections::{HashMap}; /// /// Represents a key frame /// struct InMemoryKeyFrameStorage { /// The time when this frame appears when: Duration, ...
the_stack
use crate::atom_table::*; use crate::parser::ast::*; use crate::machine::heap::*; use crate::machine::machine_errors::CycleSearchResult; use crate::machine::system_calls::BrentAlgState; use crate::types::*; use std::cmp::Ordering; use std::ops::Deref; use std::str; #[derive(Copy, Clone, Debug)] pub struct PartialStr...
the_stack
extern crate crdts; use crdt_tree::{OpMove, Tree, TreeId, TreeMeta, TreeReplica}; use crdts::Actor; use rand::Rng; use std::collections::HashMap; use std::env; // define some concrete types to instantiate our Tree data structures with. type TypeId = u64; type TypeMeta<'a> = &'static str; type TypeActor = u64; // A s...
the_stack
use std::cmp; use std::io::{self, Write}; use termion::{self, clear, color, cursor}; use Context; use Buffer; use event::*; use util; /// Represents the position of the cursor relative to words in the buffer. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum CursorPosition { /// The cursor is in the word with...
the_stack
use std::{ convert::TryFrom, io::{self, Seek, SeekFrom, Write}, }; use crate::{ low::v7400::{ArrayAttributeEncoding, ArrayAttributeHeader, AttributeType}, writer::v7400::binary::{Error, Result, Writer}, }; mod array; /// A dummy type for impossible error. pub(crate) enum Never {} impl From<Never> fo...
the_stack
use std::convert::TryInto; use indicatif::ProgressBar; use ndarray::{arr1, Array, Array1, Array2}; use ndarray_linalg::solve::Inverse; use ndarray_linalg::Norm; use crate::camera::Normalizer; use crate::gradient::gradient1d; use crate::interpolation::Interpolation; use crate::image_range::{ImageRange, all_in_range}; ...
the_stack
//! Rust code parsing and compilation. use std::any::Any; use std::ffi::{CStr, CString}; use std::io::{self, Write}; use std::path::PathBuf; use std::process::Command; use std::rc::Rc; use std::str::from_utf8; use std::sync::{Arc, Mutex}; use std::thread::Builder; use rustc; use rustc_lint; use rustc::dep_graph::Dep...
the_stack
#[derive(Clone)] pub struct UnwindState { regs: [u32; 16], vsp: u32, ucb: _Unwind_Control_Block, } extern "C" { type _Unwind_Context; } #[allow(dead_code,non_camel_case_types)] mod enums { pub type _Unwind_Reason_Code = i32; pub const _URC_OK : _Unwind_Reason_Code = 0; pub const _URC_FOREI...
the_stack
use std::error::Error; use std::sync::{Arc, Mutex}; use std::time::Duration; use std::thread::sleep; use rspotify::blocking::oauth2::{SpotifyClientCredentials, SpotifyOAuth}; use rspotify::blocking::util::get_token_by_code; use rspotify::blocking::client; use rspotify::model::album::FullAlbum; use rspotify::model::arti...
the_stack
mod particles; use self::particles::{Particle, ParticleVec, ParticleRef}; /// Helper function to assert that two iterators (one of SoA and another of AoS) are equal. fn eq_its<'a, I1, I2>(i1: I1, i2: I2) where I1: Iterator<Item = ParticleRef<'a>>, I2: Iterator<Item = &'a Particle>, { for (p1, p2) in i1.zi...
the_stack
use std::{borrow::Cow, mem::replace}; use crate::{linealyzer::Linealyzer, Event}; /// `EventSource` `parse`s byte slices from an http sse connection into sse `Events`. /// It maintains state across `parse` calls, so that an `Event` whose bytes /// are split across two calls to `parse` will be returned by the second c...
the_stack
use femtovg::{ImageFlags, ImageId, PixelFormat, RenderTarget}; use tuix_core::Store; use crate::{Column, Label, Row, Textbox, TextboxEvent, common::*}; const ICON_LEFT_DIR: &str = "\u{25c2}"; const ICON_RIGHT_DIR: &str = "\u{25b8}"; #[derive(Default, Lens)] pub struct ColorPickerData { hue: f32, sat: f32, ...
the_stack
use proc_macro::Diagnostic; use quote::{format_ident, quote}; use syn::spanned::Spanned; use std::collections::{BTreeSet, HashMap}; /// Implements #[derive(SessionDiagnostic)], which allows for errors to be specified as a struct, independent /// from the actual diagnostics emitting code. /// ```ignore (pseudo-rust) /...
the_stack
// TODO: split everything up use crate::boxed::CBox; #[cfg(feature = "layout_checks")] use abi_stable::{abi_stability::check_layout_compatibility, type_layout::TypeLayout}; use core::mem::ManuallyDrop; use core::ops::{Deref, DerefMut}; #[cfg(feature = "rust_void")] #[allow(non_camel_case_types)] pub type c_void = (); ...
the_stack
use crate::bytecode_encoder::encode_v1::encode_to_bytecode_v1; use crate::bytecode_encoder::encode_v2::{encode_composite_to_bytecode, encode_to_bytecode_v2}; use crate::bytecode_encoder::error::BindRulesEncodeError; use crate::compiler::symbol_table::*; use crate::compiler::{dependency_graph, instruction}; use crate::d...
the_stack
//! Test node peer, which simulates p2p remote peer, communicates through real p2p socket use std::collections::HashSet; use std::net::SocketAddr; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::channel; use std::sync::{Arc, RwLock}; use std::thread; use std::time::{Duration, Instant}; use futures...
the_stack
use core::fmt; use core::marker::PhantomData; use core::ops::Deref; use core::ops::DerefMut; use core::pin::Pin; use core::ptr; use as_slice::{AsMutSlice, AsSlice}; use crate::dma; use crate::embedded_time::rate::Extensions as _; use crate::hal::prelude::*; use crate::hal::serial; use crate::pac; use crate::state; us...
the_stack