text
stringlengths
3.09k
13.9k
use OwnedProperty; use simple::{SimpleFbx, ObjectId, ObjectType, Property}; pub struct Animation { curve_nodes: Vec<ObjectId>, } impl Animation { pub fn from_simple(fbx: &SimpleFbx) -> Option<Self> { // Find the first animation stack we can see TODO: Support multiple if let Some((&stack_id, re...
use std::error::Error as StdError; use std::fmt; use rocket::{ http::Status, response::{Flash, Redirect}, }; use rocket_dyn_templates::Template; use serde::{ ser::{SerializeStruct, Serializer}, Serialize, }; /// Possível erro do nosso servidor #[derive(Debug)] pub struct ServerError { /// Código d...
#![allow(clippy::transmute_ptr_to_ptr)] #![allow(clippy::transmute_ptr_to_ref)] use super::{MetaCharType, RegexOptions, SyntaxBehavior, SyntaxOperator}; use onig_sys; use std::mem::transmute; /// Meta Character State /// /// Defines if a given meta character is enabled or not within a given /// syntax. If the charact...
// // Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved. // // 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 // use crate::by...
///! Bindings for ioregionfd. use num_derive::*; use num_traits as num; use std::mem::size_of; use std::os::unix::prelude::RawFd; #[repr(C)] #[allow(non_camel_case_types)] #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] pub struct kvm_ioregion { pub guest_paddr: u64, // guest physical address pub memory_siz...
use std::fmt::{self, Display, Write as _}; use std::iter::FromIterator; #[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct TokenStream<'a>(pub Vec<Token<'a>>); impl<'a> TokenStream<'a> { pub fn matches( &'a self, pat: &TokenStream<'_>, generic: Option<&str>, ) -> Result<Option<...
use std::{fmt, str}; use std::path::Path; use inflate::inflate_bytes_zlib; #[cfg(test)] #[path = "pfs_test.rs"] mod s3d_test; const DEBUG: bool = false; /// PFSArchive describes the content of an PFS archive. pub struct PFSArchive { pub basename: String, pub files: Vec<PFSFileEntry>, } impl PFSArchive { ...
/// You can use the ? operator on Options. If x is an Option, then evaluating x? will /// 1. return the underlying value if x is Some, /// 2. otherwise it will terminate whatever function is being executed and return None. pub fn next_birthday(current_age: Option<u8>) -> Option<String> { let next_age: u8 = current...
use rsa::pkcs1::{ToRsaPublicKey, ToRsaPrivateKey}; use rust_base58::{ToBase58}; use crypto::digest::{Digest}; use crypto::sha2::{Sha256,Sha512}; use crypto::ripemd160::Ripemd160; use rsa::{PublicKey, RsaPrivateKey, RsaPublicKey, PaddingScheme}; use rand::rngs::OsRng; use std::path::Path; fn main() { ...
use glam::Vec3; /// Vertex index #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Vertex(pub u16); impl From<usize> for Vertex { fn from(v: usize) -> Self { Self(v.try_into().expect("Too many vertices")) } } /// Face edge smoothng #[derive(Clone, Copy, Debug, PartialEq, Eq...
use { ExtEventMapper, ExtFuncMapper, string }; use error::*; use libflo_event::EventMapper; use libflo_func::{ FuncMapper, Input }; use libflo_module::{ load, ModuleMapper, PathResolver }; use std::io::Write; use std::path::PathBuf; use std::ops::{ Deref, DerefMut }; use std::sync::{ Arc, RwLock }; pub struct Libflo {...
#[macro_use] extern crate arrayref; pub mod error; pub mod gcs; pub mod local; pub use gcs::*; pub use local::*; mod util; use crate::error::*; pub(crate) type Result<T, E = Error> = std::result::Result<T, E>; #[cfg(test)] mod tests { use crate::util::*; use super::*; use cloud_storage::{Client, List...
extern crate rand; use rand::Rng; use std::{char, fmt}; #[derive(Clone, Debug)] pub enum Suit { Spades, Hearts, Diamonds, Clubs, } impl fmt::Display for Suit { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let s = match *self { Suit::Spades => "♠", Suit::H...
//! Internal logic analyizer for the RP2040 //! //! This crate allows to use a PIO to periodically read out the state of all //! GPIO pins, implementing a simple logic analyzer #![no_std] use core::fmt::Write; use rp2040_hal as hal; use hal::{pac, pio::PIOExt}; /// Write the contents of dma_buf to writer, in VCD for...
use std::fmt::Write; ///Converts an array of bytes into a hex string. pub fn as_hex_string(bytes: &[u8]) -> String { let mut string_buffer = String::new(); for &byte in bytes { // Writing to a String never fails, so ignore the Result. let _ = write!(&mut string_buffer, "{:x}", byte); } ...
// from https://github.com/samrat/rusl/blob/master/src/lexer.rs // commit 0ba0f77 on Mar 10, 2020 // // this file has a few modifications made by me. // #[derive(Debug, PartialEq, Clone, Eq, Hash)] // pub enum Token { // //pub enum Token<'input> { // LParen, // RParen, // Symbol(String), // Str(String)...
use std::cell::RefCell; use std::collections::HashMap; use std::fs::File; use std::path::{is_separator, Path, PathBuf}; use std::rc::Rc; use std::time::Instant; use aw_man::natsort; use futures_util::FutureExt; use tempfile::TempDir; use tokio::sync::oneshot; use super::Archive; use crate::config::CONFIG; use crate::...
use anyhow::{anyhow, Context}; use crypto::digest::Digest; use crypto::sha1::Sha1; use log::{debug, info}; use std::io::{Read, Write}; use std::path::PathBuf; use std::process::Command; #[derive(Debug, Clone)] pub enum ArchiveKind { Source, Release, } impl Default for ArchiveKind { fn default() -> Self { ...
#[macro_export] macro_rules! html_template {() => ("<!doctype html> <html lang='en'> <head> <meta charset='utf-8'> <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'> <title>PolyDraw / Parallax</title> <meta name='viewport' content='width=device-width, initial-scale=1.0'> <...
//! This bit of code is used to generate the compaction tests for the crate. It it also a good //! example of what the crate is capable of. //#![feature(proc_macro_hygiene)] #[macro_use] extern crate log; extern crate iref; extern crate stderrlog; #[macro_use] extern crate static_iref; #[macro_use] extern crate iref_...
use std::{io, net::SocketAddr, sync::Arc, time::Duration}; use futures::{future, stream::FuturesUnordered, StreamExt}; use serde::{de::DeserializeOwned, Serialize}; use tokio::{ io::{AsyncReadExt, AsyncWriteExt}, net::{TcpListener, TcpStream}, }; use tokio_rustls::{ rustls::{ server::AllowAnyAuthen...
use std::io::{ self, StdinLock, StdoutLock, BufReader, BufRead, Write }; use std::str::FromStr; use rpassword::read_password_with_reader; use mail::{ Mailbox, Email, HeaderTryFrom, smtp::misc::Domain, header_components::{Phrase, Unstructured} }; pub struct ClDialog<'a> { stdin: BufR...
/* This example code is designed to always fail to `feed()` the watchdog so you can see that it is working as intended. When the watchdog fails, it sets the WTS bit of the WSR register on the bl602 to be 1. You can read this bit on initialization of the chip to see if the watchdog has been triggered. T...
use super::cg; use crate::world::Block; use crate::world::Chunk; impl Block { const SPRITESHEET_WIDTH: usize = 1024; const SPRITESHEET_HEIGHT: usize = 2048; const TILE_SIZE: usize = 128; const TILE_SIZE_PADDED: usize = 130; const UV_TILE_SIZE_X: f32 = Block::TILE_SIZE as f32 / Block::SPRITESHEET_WI...
// Copyright 2016 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
use serde::{Deserialize, Serialize}; use static_assertions::assert_impl_all; use std::convert::{TryFrom, TryInto}; use zbus_names::{InterfaceName, MemberName}; use zvariant::{ObjectPath, Type}; use crate::{Message, MessageField, MessageFieldCode, MessageHeader, Result}; // It's actually 10 (and even not that) but let...
use std::collections::HashMap; use super::element::Element; use super::direction::Direction; type Location = (isize, isize); const OFFSETS: [Location; 8] = [ (0, 1), // right (-1, 1), // top-right (-1, 0), // top (-1, -1), // top-left (0, -1), // left (1, -1), // bottom-left (1, 0),...
use super::tokens::*; use std::char; use std::iter::Peekable; use std::str::Chars; use util::span::{Location, Span, Spanned}; #[derive(Clone, Debug)] pub struct Lexer<'s> { input: Peekable<Chars<'s>>, current: Location, } impl<'s> Lexer<'s> { pub fn new(input: Chars<'s>) -> Lexer<'s> { Lexer { ...
#[cfg(test)] #[macro_use] extern crate quickcheck; mod cli; mod custom_ops; mod errors; mod reports; use std::{convert::TryInto, sync::Arc}; use anyhow::{anyhow, Result}; use futures::future::join_all; use structopt::{self, StructOpt}; use tokio::sync::mpsc; use binance::{BinanceFetcher, Config, RegionGlobal, Regio...
extern crate byteorder; extern crate smithay_client_toolkit as sctk; use std::cmp::min; use std::io::{BufWriter, Seek, SeekFrom, Write}; use std::sync::{Arc, Mutex}; use byteorder::{NativeEndian, WriteBytesExt}; use sctk::reexports::client::protocol::wl_seat::RequestsTrait as SeatRequests; use sctk::reexports::clien...
#[cfg(feature="serve_dir")] use std::path::{Path, PathBuf}; #[cfg(feature="serve_dir")] use mime::Mime; use anyhow::*; #[cfg(feature="serve_dir")] use tokio::{ fs::{self, File}, io, }; #[cfg(feature="serve_dir")] use crate::types::{Document, document::HeadingLevel::*}; use crate::types::Response; use std::panic...
//! # Interface //! //! ## Overview //! All Traits //! use sp_std::{ fmt::Debug, hash::Hash, }; use sp_runtime::{ traits::{ AtLeast32BitUnsigned }, }; use frame_support::{ dispatch::{result::Result, DispatchError, DispatchResult, DispatchResultWithPostInfo}, traits::Get, }; use frame_support::pallet_prelude::*; u...
use num_traits::{FromPrimitive, One, PrimInt, Signed, Zero}; use std::mem::swap; pub fn primitive_root(prime: u64) -> Option<u64> { let test_exponents: Vec<u64> = distinct_prime_factors(prime - 1) .iter() .map(|factor| (prime - 1) / factor) .collect(); 'next: for potential_root in 2..pr...
use futures::channel::mpsc as async_mpsc; use gettextrs::gettext; use gst::prelude::*; use log::{info, warn}; use std::{ collections::HashSet, path::Path, sync::{Arc, RwLock}, }; use super::{MediaEvent, Timestamp}; pub struct TocSetterPipeline { pipeline: gst::Pipeline, muxer: Option<gst::Elem...
use std::fs; use std::io; use std::io::Write; use std::path::PathBuf; use reqwest::Url; use serde::{Deserialize, Serialize}; use uuid::Uuid; // pub use crate::crypto::{BoxSecretKey, ED25519PublicKey, FromHex, SecretBoxKey}; pub use crate::crypto2::{check_box_key, check_secret_box_key, check_signature_key}; pub use cr...
/* * Copyright <NAME> 2017 * * 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, merge, publish, distribute...
use std::fmt::Display; use std::ops::Deref; use anyhow::bail; use openssl::hash::MessageDigest; use openssl::pkey::{PKey, Private}; use openssl::sign::Signer; use openssl::symm::{self, Cipher}; use crate::jwe::JweContentEncryption; use crate::JoseError; #[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum AescbcHma...
// Copyright © 2017 <NAME> // // 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, merge, publish, distribu...
use js_sys::WebAssembly; use std::cell::RefCell; use std::rc::Rc; use wasm_bindgen::prelude::*; use wasm_bindgen::JsCast; use web_sys::{ HtmlCanvasElement, KeyboardEvent, MouseEvent, WebGlBuffer, WebGlProgram, WebGlRenderingContext, WebGlShader, WebGlUniformLocation, }; #[wasm_bindgen] extern "C" { fn aler...
use crate::core::{ElectionCore, State}; use crate::error::{to_storage_error, Result}; use crate::msg::Message; use crate::{ElectionType, Event, HardState, InitialMode, Storage}; use crossbeam_channel::RecvTimeoutError; use fxhash::FxHashSet; pub struct Startup<'a, T: ElectionType> { core: &'a mut ElectionCore<T>, ...
use std::collections::{HashMap, HashSet}; use crate::listed_keywords::{ListedKeywordIndex, ListedKeywords}; use crate::word::WordIndex; use crate::word_file::WordsInFile; use crate::sentences::{TokenizedSentence, SentencePart}; use std::path::{Path, PathBuf}; use std::fs::{File, OpenOptions}; use std::io::BufRead; use ...
use sodiumoxide::crypto::{generichash, kdf}; use crate::crypto::{agree::SharedSecret, header::HeaderKey, message::MessageKey}; #[derive(Clone, PartialEq)] pub struct SessionKey(kdf::Key); impl SessionKey { const CONTEXT: [u8; 8] = *b"sessionk"; pub fn derive_from_shared_secrets( key_0: SharedSecret,...
use core::fmt; use std::error::Error; use regex::{escape, Regex}; use cli::*; use workflowy::*; use crate::cli; use crate::error::GenResult; use crate::workflowy; #[derive(Debug)] pub struct SerializerError { pub msg: String, } impl fmt::Display for SerializerError { fn fmt(&self, f: &mut fmt::Formatter<'_...
use std::{collections::HashSet, fmt}; use math::{ set::ordered_integer_set::OrderedIntegerSet, stats::standard_deviation, traits::ToIterator, }; #[derive(Copy, Clone, PartialEq, Debug)] pub struct Estimate<T> { pub bias_corrected_estimate: T, pub jackknife_mean: T, pub point_estimate_without_jackk...
#[cfg(test)] mod goodbye_test; use crate::{error::Error, header::*, packet::*, util::*}; use util::marshal::{Marshal, MarshalSize, Unmarshal}; use anyhow::Result; use bytes::{Buf, BufMut, Bytes}; use std::any::Any; use std::fmt; /// The Goodbye packet indicates that one or more sources are no longer active. #[derive...
#[cfg(all(not(feature = "record"), any(feature = "portaudio", feature = "jack")))] compile_error!("feature \"jack\" and feature \"portaudio\" cannot be enabled when feature \"record\" is disabled"); pub mod analyzer; pub mod cli; pub mod controller; pub mod session; pub mod viewer; pub extern crate common; pub extern ...
use byteorder::{BigEndian, ReadBytesExt}; use flate2::read::GzDecoder; use ndarray::{ArrayView, ArrayView1, ArrayView4}; use std::{ env, fs::{DirBuilder, File}, io::Read, iter::Iterator, }; /// See http://yann.lecun.com/exdb/mnist/ pub struct Mnist { train_images: Vec<u8>, train_labels: Vec<u8>...
use super::Statement; use std::collections::HashMap; use std::num::ParseFloatError; mod keyframe; mod marker; use keyframe::{Keyframe, KeyframeError}; use marker::MarkerError; #[derive(Debug, Clone, Copy)] pub enum Param<T: Clone + Copy> { Override(T), Reuse, } impl<T: Default + Clone + Copy> Param<T> { ...
use failure::ResultExt; use prometheus::Registry; use slog::info; use slog::Logger; use replicante_util_upkeep::Upkeep; use replicore_component_discovery_scheduler::Config as DiscoveryConfig; use replicore_component_orchestrator_scheduler::Config as OrchestratorConfig; use super::metrics::COMPONENTS_ENABLED; use sup...
//! Sankey Diagram use crate::common::{Orientation, PlotType}; use crate::Trace; use serde::Serialize; #[derive(Serialize, Debug)] pub struct Sankey<L, C> { r#type: PlotType, #[serde(skip_serializing_if = "Option::is_none")] pub orientation: Option<Orientation>, #[serde(skip_serializing_if = "Option...
use crate::{ difference::{ DeserWrapper, DiffCommandDeserWrapper, DiffCommandIgnoreValue, DiffCommandValue, DiffPathElementValue, }, Config, SerdeDiff, }; use serde::{de, Deserialize}; /// A deserializable structure that will apply a sequence of diff commands to the target /// /// # Example...
use nom::{ do_parse, error::{VerboseError, VerboseErrorKind}, named, separated_list1, tag, take_till1, take_while1, IResult, }; use std::borrow::Cow; use std::fmt::Debug; use crate::{AtLeastOne, PropertyValue, TypeOrRaw}; pub trait Parse<'a>: Sized { fn parse(input: &'a str) -> IResult<&'a str, Self,...
use crate::{ BooleanNetwork, FnUpdate, Parameter, ParameterId, ParameterIdIterator, RegulatoryGraph, Variable, VariableId, VariableIdIterator, ID_REGEX, }; use std::collections::HashMap; use std::ops::Index; /// Basic methods for safely building `BooleanNetwork`s. impl BooleanNetwork { /// Construct a new ...
use num_bigint::BigInt; use crate::mir::constant::TryExtractFromError; use crate::mir::constant::TryExtractInto; use crate::mir::value::CollKind; use crate::mir::value::NativeColl; use crate::mir::value::Value; use crate::serialization::{ sigma_byte_reader::SigmaByteRead, SerializationError, SigmaSerializable, }; ...
use std::rc::Rc; use wasm_bindgen::prelude::JsValue; use super::{Grid, CellFormatter, canvas::{remove_old_canvas, setup_grid_canvas, draw_shape, draw_line, DrawMode, set_canvas_size}}; use crate::rng::RngWrapper; use crate::cells::{ICellStrong, triangle_cell::{TriangleCellStrong, TriangleCellWeak, TriangleCell}}; pub ...
/*! `cdt` is a library for calculating [Delaunay](https://en.wikipedia.org/wiki/Delaunay_triangulation) and [constrained Delaunay](https://en.wikipedia.org/wiki/Constrained_Delaunay_triangulation) triangulations. It is optimized for correctness and speed, using exact predicates to perform point-in-circle and orientati...
mod utils; // we only compile js if we target wasm #[cfg(target_arch = "wasm32")] pub mod js; // we only compile python if we target python build #[cfg(feature = "python")] pub mod python; pub use x25519_dalek::PublicKey; pub use x25519_dalek::StaticSecret; use rand::CryptoRng; use rand::Rng; use xsalsa20poly1305::...
use std::fmt; use std::str::FromStr; use rand::{thread_rng, Rng, distributions::Standard}; use std::iter::repeat; use std::sync::Arc; use rayon::prelude::*; const LIVE_CELL: char = '@'; const DEAD_CELL: char = '.'; #[derive(PartialEq, Eq, Clone, Debug)] pub struct Board { board: Vec<bool>, survive: Arc<Vec<us...
use crate::internal::encodings::varint::*; use crate::prelude::*; use rle::RLE; use std::borrow::Borrow; use std::vec::IntoIter; // TODO: Consider compressed unicode (SCSU?) for String in general, // but in particular for schema strings. As schema strings need only // be compared and usually not displayed we can do bi...
use crate::layout::common::{coverage_or_nah, FromLowlevel, ToLowlevel}; use crate::layout::contextual::{coverage_to_slot, Slot}; use otspec::layout::coverage::Coverage; use otspec::layout::gsub8::ReverseChainSingleSubstFormat1; use otspec::tables::GSUB::GSUBSubtable; use otspec::types::*; use std::collections::BTreeMap...
mod builders; pub mod datetime; pub mod discord; mod ext; pub mod matcher; pub mod numbers; pub mod osu; pub use builders::author::Author; pub use builders::embed::EmbedBuilder; pub use builders::footer::Footer; pub use builders::message::MessageBuilder; pub use ext::ApplicationCommandExt; use hashbrown::...
use crate::acme_proto::structs::HttpApiError; use crate::endpoint::Endpoint; use acme_common::crypto::X509Certificate; use acme_common::error::Error; use attohttpc::{charsets, header, Response, Session}; use std::fs::File; use std::io::prelude::*; use std::{thread, time}; pub const CONTENT_TYPE_JOSE: &str = "applicati...
pub mod cell; pub mod gridv2; use std::collections::HashMap; use entity::builder::EntityBuilder; use entity::entity_type; use ggez::graphics::Rect; use ggez::nalgebra::Vector2; use ggez::{Context, GameResult}; use gridv2::Grid; use crate::camera::Camera; use crate::drawables::Drawables; use crate::entity::{self, Ent...
//! axfrnotify sends a NOTIFY request to a secondary name server to initiate a zone refresh for a specific domain name. #![deny(missing_docs)] extern crate clap; extern crate futures; extern crate tokio_core; extern crate trust_dns; use std::error::Error; use std::net::{SocketAddr, ToSocketAddrs}; use std::process::e...
// E - Vector // <NAME>, 2020 // Vec3<T> implements a 3D vector (packed). use crate::*; use std::{ cmp::PartialEq, fmt::{ Display, Debug, Formatter, Result }, ops::{ Add, Sub, Mul, Div, AddAssign, SubAssign, MulAss...
use std::{ collections::{HashMap, HashSet}, hash::Hash, }; use apollo_encoder::{EnumDefinition, EnumValue}; use arbitrary::Result; use crate::{ description::Description, directive::{Directive, DirectiveLocation}, name::Name, DocumentBuilder, }; /// Enums are special scalars that can only have...
use crate::{ map::WorldMap, positions::{Coordinate, Destination, Direction, Path, Position}, }; use indexmap::{ map::Entry::{Occupied, Vacant}, IndexMap, }; use std::{ cmp::Ordering, collections::BinaryHeap, hash::Hash, ops::{Add, Sub}, }; pub fn pathfind( from: &Position, desti...
use std::env; use std::fs; use std::path::PathBuf; const DEFAULT_DOSBOX: &str = "C:\\Program Files (x86)\\DOSBox-0.74\\DOSBox.exe"; const DEFAULT_DOSBOX_CONF: &str = "dosbox.conf"; // Environment variable names are prefixed with BLR for basic-launcher-rust const EV_DOSBOX: &str = "BLR_DOSBOX"; const EV_GWBASIC: &str ...
use crate::config::ClusterConfig; use crate::cpp_checker::{LocalSnippetTask, Snippet, CHUNK_SIZE}; use amqp::{protocol::basic::BasicProperties, Basic, Channel, Session, Table}; use log::{info, warn}; use ritual_common::cpp_lib_builder::CppLibBuilderOutput; use ritual_common::errors::{bail, Result, ResultExt}; use ritua...
use super::intcode::*; use super::vec2d::Compass; use super::Solution; use std::collections::HashSet; use std::env; use std::iter::FromIterator; use std::sync::mpsc::*; type Room = String; type Map = HashSet<(Room, Compass)>; type Exits = Vec<Compass>; type Item = String; type Items = Vec<Item>; type ItemBag = u32; s...
mod create_followup_message; mod create_global_command; mod create_guild_command; mod delete_followup_message; mod delete_global_command; mod delete_guild_command; mod delete_original_response; mod get_command_permissions; mod get_global_commands; mod get_guild_command_permissions; mod get_guild_commands; mod get_origi...
use std::io::Cursor; use std::pin::Pin; use std::sync::Arc; use super::hcomb_service::HCombService; use crate::error::BuzzError; use crate::flight_utils; use crate::models::actions; use crate::protobuf; use crate::serde; use arrow_flight::flight_service_server::FlightServiceServer; use arrow_flight::{ flight_servi...
use jpeg; use png; use std::cmp; use std::fs::File; use std::path::Path; use super::common; #[test] fn reftest() { let files = common::test_files(&Path::new("tests").join("reftest").join("images")); for path in &files { reftest_file(path); } } #[test] fn reftest_scaled() { let base = &Path::...
#![allow( clippy::new_without_default, clippy::needless_arbitrary_self_type, clippy::boxed_local, clippy::redundant_clone )] use std::{boxed::Box, pin::Pin, rc::Rc, sync::Arc}; #[faux::create] pub struct Owned {} #[faux::methods] impl Owned { pub fn new() -> Self { Owned {} } //n...
use std::collections::HashMap; #[derive(Debug, Eq, PartialEq, Clone)] pub struct Polymerization { polymer_template: String, pair_insertion_rules: HashMap<(char, char), char>, } impl Polymerization { // First non-scalable solution // fn step(&mut self) { // let chars = self.polymer_template.cha...
// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0. use std::vec::IntoIter; use engine_traits::CfName; use kvproto::metapb::Region; use kvproto::pdpb::CheckPolicy; use kvproto::raft_cmdpb::{AdminRequest, AdminResponse, RaftCmdRequest, RaftCmdResponse, Request}; use raft::StateRole; use txn_types::TxnEx...
//! A parser for GraphQL. Used in the [`async-graphql`](https://crates.io/crates/async-graphql) //! crate. //! //! It uses the [pest](https://crates.io/crates/pest) crate to parse the input and then transforms //! it into Rust types. #![warn(missing_docs)] #![allow(clippy::unnecessary_wraps)] #![allow(clippy::upper_cas...
// Take a look at the license at the top of the repository in the LICENSE file. use crate::prelude::*; use crate::Cancellable; use futures_channel::oneshot; use futures_core::Future; use glib::{translate::*, IsA}; use std::num::NonZeroU64; // rustdoc-stripper-ignore-next /// The id of a cancelled handler that is retu...
// Copyright 2020 - <NAME> <<EMAIL>> // SPDX-License-Identifier: Apache-2.0 use std::process; use crate::config::Config; use clap::ArgMatches; use colored::Colorize; use crypto::bech32_address_validation; use url::Url; pub(crate) mod init; pub(crate) mod node_details; pub(crate) mod run; pub(crate) mod sign; pub(cra...
use crate::{ firm::{ runtime::{self, Runtime}, FirmProgram, Options, ProgramGenerator, }, strtab::StringTable, type_checking::{type_analysis::TypeAnalysis, type_system::TypeSystem}, }; use lazy_static::lazy_static; use libfirm_rs::{bindings, types::TyTrait}; use optimization; use std::{...
//! Length (base unit meter, m). quantity! { /// Length (base unit meter, m). quantity: Length; "length"; /// Dimension of length, L (base unit meter, m). dimension: ISQ< P1, // length Z0, // mass Z0, // time Z0, // electric current Z0, // the...
use grep::regex::RegexMatcher; use grep::searcher::sinks::UTF8; use grep::searcher::Searcher; use linkify::{LinkFinder, LinkKind}; use crate::UrlLocation; use std::io; use std::path::Path; const MARKDOWN_URL_PATTERN: &str = r#"(http://|https://)[a-z0-9]+([-.]{1}[a-z0-9]+)*(.[a-z]{2,5})?(:[0-9]{1,5})?(/.*)?"#; p...
//! Utils for matrix and vector operations use ark_ec::msm::{FixedBaseMSM, VariableBaseMSM}; use ark_ec::{AffineCurve, PairingEngine, ProjectiveCurve}; use ark_ff::{PrimeField, Zero}; use ark_std::cfg_iter; use ark_std::marker::PhantomData; use ark_std::ops::{AddAssign, Mul}; use ark_std::vec; use ark_std::vec::Vec; ...
use std::fs; use std::io; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::sync::{mpsc, Arc, Mutex}; use std::thread; use snafu::{ensure, ResultExt, Snafu}; use super::{DirHook, DropDir, Status, StatusTracker}; #[derive(Debug, Snafu)] pub enum Error { #[snafu(display("Failed to move t...
/*! A data structure that provides efficient lookup of partially filled words. */ use crate::File; use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; use std::fmt; #[derive(Clone, Serialize, Deserialize)] pub struct TrieNode { contents: Option<char>, children: FxHashMap<char, TrieNode>, is_ter...
use std::collections::HashMap; use std::mem::replace; use std::sync::Arc; use std::time::{Duration, Instant}; use tokio::sync::RwLock; struct MaxSize { max_size: usize, filo: Vec<String>, index: usize, } struct Timeout { timeout: Duration, id_to_time: HashMap<String, Instant>, } impl Timeout { ...
use super::cell::*; use super::point::Point; use super::search_info::*; pub const MAZE_WIDTH: usize = 32; pub const MAZE_HEIGHT: usize = 32; /// 迷路管理の親 pub struct Explorer { /// 開始位置 pub start: Point, /// ゴール位置 pub goal: Point, /// 各マスごとの情報 pub cells: [[Cell; MAZE_WIDTH]; MAZE_HEIGHT], ///...
#[macro_use] extern crate anyhow; #[macro_use] extern crate log; use anyhow::Result; use abstio::MapName; use abstutil::{Tags, Timer}; use geom::{Distance, FindClosest, GPSBounds, LonLat, Polygon, Pt2D, Ring}; use map_model::raw::RawMap; use map_model::{osm, raw, Amenity, MapConfig}; use serde::{Deserialize, Serializ...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 //! Low-level module for establishing connections with peers //! //! The main component of this module is the [`Transport`] trait, which provides an interface for //! establishing both inbound and outbound connections with remote peers....
use crate::search::*; use crate::util::*; use serde::ser::{Serialize, SerializeMap, Serializer}; /// Returns documents that contain terms matching a /// [regular expression](https://en.wikipedia.org/wiki/Regular_expression). /// /// A regular expression is a way to match patterns in data using placeholder characters, ...
// Copyright 2017 <NAME> // // 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 to those terms. ...
// Copyright Rivtower Technologies LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed ...
use num_complex::Complex; use num_traits::Num; use num_traits::Zero; use serde::{Deserialize, Serialize}; use super::color::Color; use super::range::Range; use super::rectangle::Rectangle; use super::vector::Vector; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(default)] pub struct Config { #[serde(ski...
//! Module responsible for sending custom status change to mattermost. use crate::mattermost::BaseSession; use crate::utils::parse_from_hmstr; use anyhow::Result; use chrono::{DateTime, Local}; use derivative::Derivative; use serde::{Deserialize, Serialize}; use serde_json as json; use std::fmt; use thiserror::Error; u...
extern crate clap; extern crate quick_xml; use clap::{Arg, App}; use std::ffi::OsStr; use std::path::Path; use std::fs; use std::fs::File; use std::io::Write; use std::io::BufReader; use std::str; use std::collections::HashMap; use quick_xml::reader::Reader; use quick_xml::events::Event; //Read all xml files in a d...
use ansi_term::Colour::{Fixed, Green, Red, White, Yellow}; use ansi_term::Style; use app::Config; use console::AnsiCodeIterator; use decorations::{Decoration, GridBorderDecoration, LineChangesDecoration, LineNumberDecoration}; use diff::LineChanges; use errors::*; use std::boxed::Box; use std::io::Write; use std::vec::...
//! Proposal Account use solana_program::{ account_info::AccountInfo, epoch_schedule::Slot, program_error::ProgramError, program_pack::IsInitialized, pubkey::Pubkey, }; use crate::{ error::GovernanceError, id, tools::account::{deserialize_account, AccountMaxSize}, PROGRAM_AUTHORITY_SEED, }; ...
use regex::Regex; use std::collections::HashMap; use std::collections::HashSet; // literals pub const IDENTIFIER: u8 = 37; pub const INT: u8 = 38; pub const FLOAT: u8 = 39; pub const STRING: u8 = 40; pub struct Token { pub token_string: String, pub token_num: u8, pub line_num: u64, } impl Token { pu...
use jsonschema_equivalent::jsonschema_equivalent_ref; use pathsep::{join_path, path_separator}; use serde_json::{from_str, Value}; use std::io::Write; use std::str::FromStr; /// This method does expose the one-liner pretty-print value of a given JSON value /// Respect the default `Value::to_string` method this ensures...
//! A simple data-flow analysis for finding string constants. //! //! This analysis is currently used to perform constant folding on regular expressions, and //! tracking accesses to the `FI` builtin variable for help in increasing the precision in the //! used-field analysis when passing the -H flag. use crate::builti...