text
stringlengths
7.05k
33.9k
use std::f32::consts::PI; use std::ops::Not; use bevy::prelude::*; use bevy::render::mesh::*; use hashbrown::{HashMap, HashSet}; use rand::distributions::{Distribution, Standard}; use rand::Rng; use crate::phys::*; use crate::room::*; pub mod walls; #[derive(Debug, Clone, Copy)] pub struct Connection { pub this...
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
use super::*; use crate::dispatcher::{ Dispatcher, DispatcherLogic, SingleThreadedDispatcher, WorkStealingDispatcher, }; use crate::mailbox::{ CrossbeamChannelMailboxLogic, CrossbeamSegQueueMailboxLogic, VecDequeMailboxLogic, }; use crate::timer::{Ticker, TimerThunk}; use crossbeam::atomic::AtomicCell; use cros...
//! YubiKey-related types and communication support // Adapted from yubico-piv-tool: // <https://github.com/Yubico/yubico-piv-tool/> // // Copyright (c) 2014-2016 Yubico AB // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the ...
#![feature(never_type)] #![feature(try_trait_v2)] #![feature(control_flow_enum)] #![warn(deprecated_in_future)] #![warn(future_incompatible)] #![warn(nonstandard_style)] #![warn(rust_2018_compatibility)] #![warn(rust_2018_idioms)] #![warn(trivial_casts, trivial_numeric_casts)] #![warn(unused)] #![warn(clippy::all, cl...
// wengwengweng //! Graphics //! //! ## Drawing Stuff //! //! ## Custom Shader //! //! Use [`Shader`](Shader) to create custom shaders. It requires a type that implements [`CustomUniform`](CustomUniform), see [this example](https://git.sr.ht/~slmjkdbtl/DIRTY/tree/master/examples/shader.rs) for usage //! //! custom sha...
use flate2::{read::GzDecoder, write::GzEncoder, Compression}; use rug::{ops::Pow, Assign, Integer}; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use std::fs::File; use std::io::{BufRead, BufReader}; use std::ops::{Index, MulAssign, RemAssign}; use std::path::PathBuf; use std::rc::Rc; use super...
// Copyright (c) 2015, The Radare Project. All rights reserved. // See the COPYING file at the top-level directory of this distribution. // Licensed under the BSD 3-Clause License: // <http://opensource.org/licenses/BSD-3-Clause> // This file may not be copied, modified, or distributed // except according to those term...
use std::cell::RefCell; use std::hash::Hash; use std::rc::Rc; use anyhow::Result; use itertools::Itertools; use crate::algorithms::cache::{CacheImpl, FstImpl, StateTable}; use crate::algorithms::compose::compose_filters::{ AltSequenceComposeFilter, ComposeFilter, MatchComposeFilter, NoMatchComposeFilter, Null...
//! Adapted from the `madgwick` crate: <https://github.com/japaric/madgwick> //! Copyright (c) 2018 <NAME> //! //! Original sources dual licensed under your choice of the Apache 2.0 //! and/or MIT licenses, which matches this crate's licensing terms. //! //! See toplevel LICENSE-MIT for more information on the MIT lice...
//! Tree-searching _Sudoku_ solver using forward checking. 🎲 //! //! # Example //! ``` //! # use sudoku::sudoku; //! let mut sudoku = sudoku! [ //! _ 6 4 2 _ _ 9 3 _ //! _ _ _ 6 _ _ _ _ _ //! _ 3 _ 7 _ _ _ 1 _ //! _ _ _ _ _ _ 6 7 2 //! _ _ _ _ 1 _ _ _ _ //! 8 9 2 _ _ _ _ _ _ //! _ 5 _ _ _ 4...
use petgraph::graph::EdgeIndex; use petgraph::graph::NodeIndex; use petgraph::stable_graph::StableGraph; use crate::component::*; use crate::instance::*; use std::cell::RefCell; use std::collections::HashMap; use std::ops::IndexMut; use std::rc::Rc; // TODO: Add threadpool concurrency via rayon crate (https://docs.rs...
use crate::{Database, ProteinExistence}; use nom::{ branch::alt, bytes::complete::{tag, take, take_until, take_while1, take_while_m_n}, character::{is_alphanumeric, is_digit}, combinator::opt, error::ErrorKind, sequence::{pair, preceded, separated_pair, tuple}, IResult, Slice, }; use once_ce...
use std::num::Wrapping; use std::rc::Rc; use crate::bus::Bus; use crate::types::*; // enums pub mod enums; // instruction set mod alu; mod alu16; mod block; mod ctrl; mod iops; mod ld_16bit; mod ld_8bit; mod rot; mod special; mod stack; // instruction decode and dispatch mod dispatch; // peripherals mod mmu; mod r...
use proc_macro2::{Ident, Literal, Span, TokenStream}; use quote::{quote, quote_spanned}; use syn::{ parse::{Parse, ParseStream}, parse_quote, punctuated::Punctuated, spanned::Spanned, token::Comma, Data, DataStruct, DeriveInput, Error, Fields, FieldsNamed, GenericParam, LitInt, Path, Type, }; p...
mod background; mod configs; mod constants; mod desktop_item; mod desktop_manager; mod errors; mod gui; mod proxy_message; mod window_state; use background::WallpaperItem; use configs::PersistentData; use desktop_item::DesktopItem; use desktop_manager::DesktopManager; use tauri_dialog::{DialogBuilder, DialogButtons, Di...
use crate::robotic::{parse_program, Command}; use crate::{ get_bool, get_byte, get_dword, get_null_terminated_string, get_word, load_palette, Board, BoardId, ByteString, ColorValue, OverlayMode, Robot, World, WorldError, CHARSET_BUFFER_SIZE, LEGACY_BOARD_NAME_SIZE, LEGACY_ROBOT_NAME_SIZE, Scroll, Sensor, };...
//! The `solve` function is the main generic entry-point. This delegates //! to the specific `solve_X` functions. #![allow(unused_variables)] use helper; use recurrence::RecurrenceEquation; /// Represents a solution that may be returned when evaluating an equation. /// /// # Todo /// Recurrences feel more natural as...
// Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved. // // SPDX-License-Identifier: BSD-3-Clause //! AFLTriage's native "Enriched" report type. //! //! Enriched reports start with [EnrichedTriageInfo], which contains a crash summary, stop //! information, faulting frame info, sanitizer reports (...
use super::*; struct ArmAttributes { pub generics_attr: Option<GenericsAttr>, pub capture_attr: Option<CaptureAttr>, pub default_attr: Option<()>, } pub fn translate_match_expr( match_: &ExprMatch, env: &mut Env, items: &mut Vec<Item>, ) -> syn::Result<TypeVar> where { let ExprMatch { expr...
use std::cmp::Ordering; use std::fmt; use std::fs::File; use std::io::{self, BufRead, BufReader}; use std::num::NonZeroU8; use std::str::FromStr; /// A book of the Bible. /// /// This includes the 66 books of the Protestant Bible, plus 20 /// books/additions used in the Catholic and Eastern Orthodox traditions. // tod...
use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, PrintDiagnosticsPlugin}, input::mouse::MouseMotion, prelude::*, render::{ mesh::{shape, VertexAttributeValues}, pipeline::{DynamicBinding, PipelineDescriptor, PipelineSpecialization, RenderPipeline}, render_graph::{base, AssetR...
use pixels::{Pixels, SurfaceTexture}; use winit::window::WindowBuilder; use winit::{ dpi::PhysicalPosition, event_loop::{ControlFlow, EventLoop}, }; use winit::{ dpi::Position, event::{Event, VirtualKeyCode, WindowEvent}, }; use winit_input_helper::WinitInputHelper; use prisma_maths::*; use terra_rende...
use crate::server::helpers::{send_error, send_response}; use futures_channel::{mpsc, oneshot}; use futures_util::{future::BoxFuture, FutureExt}; use jsonrpsee_types::error::{CallError, Error, SubscriptionClosedError}; use jsonrpsee_types::v2::error::{JsonRpcErrorCode, JsonRpcErrorObject, CALL_EXECUTION_FAILED_CODE}; us...
extern crate ilc_base; extern crate ilc_ops; extern crate ilc_format_weechat; extern crate ilc_format_energymech; extern crate chrono; #[macro_use] extern crate clap; #[macro_use] extern crate log; extern crate env_logger; extern crate serde; extern crate serde_json; extern crate glob; extern crate regex; use ilc_base...
/******************************************************************************* * * Copyright (c) 2019 <NAME> * * ----------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated docum...
#[doc = r" Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - SCT configuration register"] pub config: CONFIG, #[doc = "0x04 - SCT control register"] pub ctrl: CTRL, #[doc = "0x08 - SCT limit register"] pub limit: LIMIT, #[doc = "0x0c - SCT halt condition register"] p...
use crate::drbd::{ BackingDevice, Connection, ConnectionState, Device, DiskState, EventType, EventUpdate, Path, PeerDevice, ReplicationState, Resource, Role, }; use anyhow::Result; use log::{debug, warn}; use regex::Regex; use std::io::BufRead; use std::io::BufReader; use std::io::Write; use std::process::{Comm...
// 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 governed by a BSD-style license that can be // found in the LICENSE-BSD-3-Clause file. // // Copyright © 2020 Intel Corporation // // SPDX-...
use syntax::symbol::InternedString; use syntax_pos::Span; use crate::ty::{self, Ty, TyVid}; use std::cmp; use std::marker::PhantomData; use std::u32; use std::ops::Range; use rustc_data_structures::snapshot_vec as sv; use rustc_data_structures::unify as ut; pub struct TypeVariableTable<'tcx> { values: sv::Snapsho...
pub mod node_data; use crate::key::Key; use crate::node::node_data::{NodeData, NodeDataDistancePair}; use crate::protocol::{Message, Protocol, Request, RequestPayload, Response, ResponsePayload}; use crate::routing::RoutingTable; use crate::storage::Storage; use crate::{ BUCKET_REFRESH_INTERVAL, CONCURRENCY_PARAM,...
//! # Commandline parsing //! //! While there is a separate `ostree-ext-cli` crate that //! can be installed and used directly, the CLI code is //! also exported as a library too, so that projects //! such as `rpm-ostree` can directly reuse it. use anyhow::Result; use ostree::{gio, glib}; use std::collections::BTreeMa...
/* Copyright (c) Fortanix, Inc. * * Licensed under the GNU General Public License, version 2 <LICENSE-GPL or * https://www.gnu.org/licenses/gpl-2.0.html> or the Apache License, Version * 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0>, at your * option. This file may not be copied, modified, or ...
//! Procedural macro for the `#[async]` attribute. //! //! This crate is an implementation of the `#[async]` attribute as a procedural //! macro. This is nightly-only for now as it's using the unstable features of //! procedural macros. Furthermore it's generating code that's using a new //! keyword, `yield`, and a new...
#![no_std] #![no_main] use core::panic::PanicInfo; //use stm32::interrupt; use rtt_target::rprintln; use stm32f4xx_hal as hal; use hal::gpio::{Alternate, NoPin, Output, Pin, PushPull}; use hal::pac; use hal::spi; use hal::spi::Spi; use wm8731_another_hal::prelude::*; type MyWm8731 = Wm8731< SPIInterfaceU8< ...
// #[repr(u16)] // pub enum CompressType { // COMPRESS_NONE = 1, // COMPRESS_CCITT = 2, // COMPRESS_G3 = 3, // Group 3 Fax. // COMPRESS_G4 = 4, // Group 4 Fax. // COMPRESS_LZW = 5, // COMPRESS_JPEGOLD = 6, // Superseded by cJPEG. // COMPRESS_JPEG = 7, // COMPRESS_DEFLATE = 8, // zlib com...
//! A platform-agnostic driver crate for the Microchip PAC194X single/multi channel power monitor using the embedded-hal traits. //! //! # Usage //! //! ```rust //! use linux_embedded_hal::I2cdev; //! use pac194x::{PAC194X, AddrSelect}; //! //! const SENSE_RESISTOR: f32 = 0.5; //! //! fn main() { //! let i2c = I2cd...
use js_sys::Math::{sin, cos, sqrt}; use crate::types::DEG_TO_RAD; use crate::vector::*; pub const MAT3_BLANK : Mat3 = Mat3 { m: [VEC3_BLANK, VEC3_BLANK, VEC3_BLANK] }; pub const MAT4_BLANK : Mat4 = Mat4 { m: [VEC4_BLANK, VEC4_BLANK, VEC4_BLANK, VEC4_BLANK] }; pub const MA...
use std::{cell::RefCell, collections::HashSet}; use crate as pallet_assembly; use frame_support::{ parameter_types, sp_tracing, traits::{FindAuthor, Imbalance, OnInitialize, OnUnbalanced, OneSessionHandler}, weights::constants::RocksDbWeight, }; use frame_election_provider_support::onchain; use pallet_sta...
#[cfg(any(feature = "otlp-grpc", feature = "otlp-http"))] mod otlp; use crate::apollo_telemetry::new_pipeline; use crate::apollo_telemetry::SpaceportConfig; use crate::apollo_telemetry::StudioGraph; use crate::configuration::{default_service_name, default_service_namespace}; use crate::layers::opentracing::OpenTracing...
// Copyright <NAME> 2017 - 2018. // Dual-licensed under either the MIT License or the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) mod blend; pub use self::blend::{blend, over}; use std::collections::VecDeque; use std::mem::transmute...
//! Simplified mesh generator. use std::sync::Arc; use std::collections::HashSet; use cgmath::Point3; use vulkano::device::Device; use geometry::{Mesh, VertexPositionNormalUVColor, VertexGroup}; use util::Transform; use memory::pool::AutoMemoryPool; use voxel::voxelstorage::*; use voxel::voxelmath::*; use world::bl...
//! This module contains types used throughout the IMAP protocol. use std::borrow::Cow; /// From section [2.3.1.1 of RFC 3501](https://tools.ietf.org/html/rfc3501#section-2.3.1.1). /// /// A 32-bit value assigned to each message, which when used with the unique identifier validity /// value (see below) forms a 64-bit...
use common::num::Cast; use itertools::zip_eq; use packer::Unpacker; use std::cmp; use std::fmt; use std::ops; use vec_map::VecMap; use bitmagic::CallbackExt; use format::MaybeEnd; use format::item::INPUT_LEN; use format::item; use format; pub use format::Header; macro_rules! unexp_end { ($e:expr) => { un...
use icfpc2021::{*, util::*}; use icfpc2021::paths::render_pose_svg; // // 浮動小数点数ベクトル用ユーティリティ // type Pf = P<f64>; fn into_pf(p: Point) -> Pf { P(p.0 as f64, p.1 as f64) } fn into_pi(p: Pf) -> Point { P(p.0.round() as i64, p.1.round() as i64) } fn mul(p: Pf, x: f64) -> Pf { P(p.0 * x, p.1 * x) } fn norm...
//- kubeapi module to track upgrades use crate::{kubeapi::ShipKube, slack::short_ver, Result}; use chrono::{Duration, Utc}; use k8s_openapi::api::{ apps::v1::{Deployment, ReplicaSet, StatefulSet}, core::v1::Pod, }; use kube::api::{Meta, ObjectList}; use shipcat_definitions::{Manifest, PrimaryWorkload}; use std:...
// Copyright (c) 2018-2020 MobileCoin Inc. // Thread-based simulation for consensus networks. use mc_common::{ logger::{log, Logger}, NodeID, }; use mc_consensus_scp::{ core_types::{CombineFn, SlotIndex, ValidityFn}, msg::Msg, node::{Node, ScpNode}, quorum_set::QuorumSet, test_utils, }; us...
//! //! Description: //! Simple ORAC serial driver that talks to the Muses instrument to handle //! button presses, encoder rotations, and Sensel touches. //! //! This is designed specfically for comunicating with MEC/ORAC and stores //! some additional information about controllers and so on. //! //! ...
use std::borrow::Cow; use std::collections::HashMap; use std::sync::Arc; use std::time::{Duration, Instant}; use ckb_logger::{debug, error, trace, warn}; use p2p::{ bytes::Bytes, context::{ProtocolContext, ProtocolContextMutRef, SessionContext}, multiaddr::{Multiaddr, Protocol}, service::{SessionType, ...
use crate::address_space::AddressSpace; use crate::audio::AudioConsumer; use crate::frame_renderer::FrameRenderer; use crate::riot; use crate::riot::Riot; use crate::tia; use crate::tia::Tia; use enum_map::{enum_map, Enum, EnumMap}; use image; use image::RgbaImage; use std::error; use ya6502::cpu::Cpu; use ya6502::memo...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. use super::{inherit::Inherited, subst::Subst, subst::Substitution}; use crate::alloc::Allocator; use crate::decl_defs::{ AbstractTyp...
use std::cell::RefCell; use std::cmp::PartialEq; use std::fmt; use std::hash::{Hash, Hasher}; use std::rc::Rc; use colored::*; use indexmap::IndexMap; /// Represent all errors that may occur during the transpilation. #[derive(Debug, PartialEq)] pub enum Error { Preprocessing { message: String, location: Location ...
use core::fmt::Debug; use alloc::{collections::BTreeMap, sync::Arc, vec::Vec}; use riscv::register::satp; use spin::Mutex; use crate::{ config::{MEMORY_END, MMIO, PAGE_SIZE, TRAMPOLINE, TRAP_CONTEXT, USER_STACK_SIZE}, mm::address::StepByOne, }; use super::{frame_alloc, PTEFlags, PageTableEntry, PhysPageNum};...
// Copyright (C) 2016 by <NAME> // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to ...
use std::cmp::min; use std::error::Error as StdError; use std::fmt::{self, Display, Formatter}; use std::io::{self, IoSliceMut, Read}; #[cfg(unix)] use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; #[cfg(windows)] use std::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle}; use std::sy...
use std::collections::HashMap; use serde::{Deserialize, Serialize}; /// Linux contains platform-specific configuration for Linux based containers. #[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, Clone)] pub struct Linux { /// UIDMapping specifies user mappings for supporting user namespaces. #...
#![feature(test)] extern crate rustfft; extern crate test; use rustfft::num_complex::Complex; use rustfft::num_traits::Zero; use rustfft::Fft; use std::sync::Arc; use test::Bencher; /// Times just the FFT execution (not allocation and pre-calculation) /// for a given length fn bench_planned_f32(b: &mut Bencher, len:...
#![allow(dead_code, unused_assignments)] use std::fmt; use super::{lookup, Array, BitWidth, Reader}; #[derive(Debug, PartialEq, Eq)] pub enum DecodeError { /// The instruction has an impossible size. InvalidInputSize(usize), } // An Intel/AMD/IA-32 instruction is made up of up to 15 bytes. #[derive(Debug, P...
#![allow(clippy::single_match)] #![allow(clippy::len_zero)] #[cfg(feature = "dx12")] extern crate gfx_backend_dx12 as back; #[cfg(feature = "metal")] extern crate gfx_backend_metal as back; #[cfg(feature = "vulkan")] extern crate gfx_backend_vulkan as back; use gfx_hal::{ adapter::PhysicalDevice, command::{ClearC...
//! Ring buffer wrapper for communicating with the Media Driver use crate::concurrent::AtomicBuffer; use crate::util::bit::align; use crate::util::{bit, AeronError, IndexT, Result}; use std::ops::{Deref, DerefMut}; /// Description of the ring buffer schema pub mod buffer_descriptor { use crate::util::bit::{is_powe...
use crate::config::{self, write_config}; use crate::lists::import_tasks_from_clipboard; use crate::macros::{get_macro_for_recipe, read_macros_from_file, Macro}; use crate::rpc::{Request, Response}; use crate::task::{Status, Task}; use std::path::PathBuf; use gui_support; use imgui::*; use std::cmp::{max, min}; use std...
#![no_std] #![no_main] #![feature(asm, const_ptr_offset)] mod stivale; // Allocate 8 KiB for the stack. static STACK: [u8; 8192] = [0u8; 8192]; static STIVALE2_FRAMEBUFFER_TAG: stivale::stivale2_header_tag_framebuffer = stivale::stivale2_header_tag_framebuffer { tag: stivale::stivale2_header_tag { identifier: sti...
//! Rendering service and system, pipelines, abstractions for models, transformation, skybox, //! lights and overlay pub mod bind_group_layout; pub mod color; mod light; pub mod pipeline; pub mod skybox; mod model; mod overlay; mod widget; mod wireframe; pub mod transform; pub use color::Color; pub use transform::Tran...
use bytes::Bytes; use futures::{FutureExt, SinkExt}; use http::{ header, header::{HeaderMap, HeaderName, HeaderValue}, Request, StatusCode, Uri, }; use hyper::Body; use once_cell::sync::Lazy; use openssl::{base64, hash, pkey, sign}; use regex::Regex; use serde::{Deserialize, Serialize}; use serde_json::Valu...
//! Functions for conversion between raw data chunks and a custom data structure, //! which contains the voxel scene represented by those chunks. //! //! Public methods: //! - [`to_custom`] //! - [`from_custom`] // Stdlib imports use std::collections::HashMap; // External library imports use nom::combinator::all_con...
//! Library implements xor-filter. //! //! This is a port of its //! [original implementation](https://github.com/FastFilter/xorfilter) //! written in golang. use std::fs::File; use std::io; use std::io::{Error, ErrorKind, Read, Write}; fn murmur64(mut h: u64) -> u64 { h ^= h >> 33; h = h.wrapping_mul(0xff51a...
// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// RGB standard library // Written in 2020 by // Dr. <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. This software is distributed without // any warranty. // // You should ha...
use std::any::TypeId; use std::collections::HashMap; use std::rc::Rc; use num_traits::cast::ToPrimitive; use libeir_intern::Ident; use libeir_ir::constant::{AtomicTerm, Const, ConstKind}; use libeir_ir::operation::binary_construct::{ BinaryConstructFinish, BinaryConstructPush, BinaryConstructStart, }; use libeir_...
#![feature(question_mark)] #[macro_use(header)] extern crate hyper; #[macro_use(log, warn)] extern crate log; #[macro_use(row, cell)] extern crate prettytable; extern crate backtrace; extern crate chrono; extern crate regex; extern crate select; extern crate rustc_serialize; extern crate argparse; use std::io; use pre...
// Copyright 2017 Dropbox, 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 ag...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use anyhow::{ensure, Result}; use libra_types::PeerId; use rand::{rngs::StdRng, SeedableRng}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use std::{ fmt, fs::File, io::{Read, Write}, path::{Path, PathBuf}...
use crate::{Credentials, Mode, Store}; use anyhow::{anyhow, Result}; use async_trait::async_trait; use bytes::Buf; use chrono::{NaiveDate, Utc}; use http::{ header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE}, Method, Request, Response, }; use serde::de::DeserializeOwned; use serde::ser::Serialize; use tokio::io::{self,...
// Config.rs handles configuration parsing. extern crate serde; extern crate serde_derive; extern crate toml; extern crate regex; extern crate exitcode; extern crate base64; use std::{collections::HashMap, fs, process, path::Path}; use regex::{RegexSet, Regex, NoExpand}; use trim_prefix; // ConfStruct objects are used...
use crate::glyf::Glyph; use crate::otvar::Delta; use otspec::types::*; use std::collections::{HashMap, HashSet}; fn iup_segment( newdeltas: &mut Vec<(i16, i16)>, coords: &[(i16, i16)], rc1: (i16, i16), rd1: &Option<Delta>, rc2: (i16, i16), rd2: &Option<Delta>, ) { let rd1 = rd1.as_ref().unw...
/* Advent of Code 2020 <NAME> Day 20 Solution 2020-12-20 -- 2020-12-22 Time (--release): 0m0.055s */ use aoc2020::util::file_to_vec; use std::collections::HashMap; /* Tiles are stored as Boolean grids. They support the following: - Naming edges: EdgeInfo can be used to give unique ...
use std::fmt::{self, Display}; use super::{joined, joined_locatable}; use crate::data::lex::{AssignmentToken, ComparisonToken, Literal, Locatable}; use crate::intern::InternedStr; pub type Program = Vec<Declaration>; #[derive(Clone, Debug, PartialEq)] pub enum ExternalDeclaration { Function(FunctionDefinition), ...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
//! This module contains various methods and utilities for analyzing the DOM and/or the syntax tree. use std::iter::FromIterator; use crate::{ dom::{self, NodeSyntax, TextRanges}, syntax::SyntaxToken, syntax::{ SyntaxElement, SyntaxKind::{self, *}, }, util::StrExt, }; use rowan::{T...
//! prototype module for bridging in ethereum pow blockchain, including mainnet and ropsten. #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "128"] #[cfg(all(feature = "std", test))] mod mock; #[cfg(all(feature = "std", test))] mod mock_headers; #[cfg(all(feature = "std", test))] mod tests; // --- th...
use crate::col_usage::{compute_insert_schema, free_external_cols}; use crate::common::{ lookup, lookup_pos, mk_qid, ColBound, CoreIOCtx, KeyBound, OrigP, PolyColBound, QueryESResult, QueryPlan, ReadRegion, SingleBound, Timestamp, WriteRegion, WriteRegionType, }; use crate::expression::{ compress_row_region, const...
pub mod map; use rand::Rng; use rand_xoshiro::rand_core::SeedableRng; use rand_xoshiro::Xoshiro128StarStar; use std::collections::VecDeque; use std::f32::consts::PI; use std::sync::Arc; use std::time::SystemTime; cfg_if! { if #[cfg(target_arch = "wasm32")] { use wasm_bindgen::prelude::*; } ...
use color_eyre::eyre::WrapErr; use color_eyre::Report; use fantoch_plot::plot::pyplot::PyPlot; use pyo3::prelude::*; use std::collections::{BTreeMap, HashMap}; use std::fmt; // file with the output of simulation const SIM_OUTPUT: &str = "sim.out"; // folder where all plots will be stored const PLOT_DIR: Option<&str> ...
use std::error::Error; use std::fmt::Write; use std::fs; use std::path::{Path, PathBuf}; use std::process::Command; use walkdir::WalkDir; mod groups; pub struct LintExtractor<'a> { /// Path to the `src` directory, where it will scan for `.rs` files to /// find lint declarations. pub src_path: &'a Path, ...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::{cache::Cache, resolver::Resolver}, anyhow::{anyhow, Context, Error}, fidl::endpoints::{ClientEnd, DiscoverableProtocolMarker}, ...
// Copyright Materialize, Inc. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License...
// Copyright (c) 2017 <NAME>, RWTH Aachen University // // 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 exc...
// The MIT License (MIT) // // Copyright (c) 2015 <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, mo...
use engine::GraphicsManager; use kiss3d::{ camera::Camera, event::{Action, Key, Modifiers, WindowEvent}, loader::obj, planar_camera::PlanarCamera, post_processing::PostProcessingEffect, text::Font, window::{State, Window}, }; use na::{self, Point2, Point3}; use ncollide2d::{utils::Generation...
use std::convert::TryFrom; use crate::parenthesized::Parenthesized; use heck::CamelCase; use proc_macro::TokenStream; use proc_macro2::Span; use quote::ToTokens; use syn::{ parse_macro_input, parse_quote, spanned::Spanned, Attribute, Error, FnArg, Ident, ItemTrait, ReturnType, TraitItem, Type, }; /// Implemen...
//! The functions within Knight. use crate::{Value, RuntimeError, Number, Environment, RcString}; use std::fmt::{self, Debug, Formatter}; use std::hash::{Hash, Hasher}; use std::collections::HashMap; use std::convert::{TryInto, TryFrom}; use std::sync::Mutex; // An alias to make life easier. type FuncPtr = fn(&[Value...
use super::NaiveDateTime; use crate::naive::{NaiveDate, MAX_DATE, MIN_DATE}; use crate::oldtime::Duration; use crate::Datelike; use std::i64; #[test] fn test_datetime_from_timestamp() { let from_timestamp = |secs| NaiveDateTime::from_timestamp_opt(secs, 0); let ymdhms = |y, m, d, h, n, s| NaiveDate::from_ymd(y...
use winapi::shared::guiddef::GUID; use winapi::shared::minwindef::{ATOM, FALSE, LPARAM, LRESULT, UINT, WPARAM}; use winapi::shared::windef::{HWND, RECT}; use winapi::um::combaseapi::CoCreateGuid; use winapi::um::winuser::{ AdjustWindowRectEx, CreateWindowExW, DefWindowProcW, DispatchMessageW, GetMessageW, GetWi...
extern crate divvunspell; use std::sync::Arc; use std::{path::Path, time::Instant}; use divvunspell::archive::{SpellerArchive, ZipSpellerArchive}; use divvunspell::speller::{Speller, SpellerConfig}; use divvunspell::transducer::hfst::HfstTransducer; fn run(speller: Arc<dyn Speller + Send + Sync>, line: &TestLine, cf...
//TODO Clean! use crate::{texture, Camera, DISPLAY_RES}; use anyhow::*; use cgmath::prelude::*; use log::{debug, error, info, trace, warn}; use wgpu::{util::DeviceExt, BlendState}; use winit::event::{ElementState, KeyboardInput, VirtualKeyCode, WindowEvent}; const VERTICES: &[Vertex] = &[ Vertex { positio...
use std::str; use chrono::{DateTime, NaiveDateTime, TimeZone, Utc}; use nom::{be_u16, be_u32, be_u8, rest, IResult}; use num_traits::FromPrimitive; use smallvec::SmallVec; use crypto::aead::AeadAlgorithm; use crypto::hash::HashAlgorithm; use crypto::public_key::PublicKeyAlgorithm; use crypto::sym::SymmetricKeyAlgorit...
use image::{ImageBuffer, ConvertBuffer, Rgb, Rgba, Luma, GenericImageView, GrayImage}; use crate::{create_threshold, add_border, segmentation, decode}; use std::time::Instant; use std::collections::HashMap; use imageproc::drawing::{draw_hollow_circle_mut, draw_text_mut, draw_antialiased_line_segment, draw_line_segment_...
#![deny(clippy::pedantic)] #![allow(clippy::missing_errors_doc)] // I'm too lazy mod err; mod nss; mod rw; pub use err::Error; pub use nss::hpke::{AeadId, KdfId, KemId}; use err::Res; use nss::aead::{Aead, Mode, NONCE_LEN}; use nss::hkdf::{Hkdf, KeyMechanism}; use nss::hpke::{Hpke, HpkeConfig}; use nss::{random, Pri...
//! Diagnostics related methods for `Ty`. use crate::ty::subst::{GenericArg, GenericArgKind}; use crate::ty::{ ConstKind, DefIdTree, ExistentialPredicate, ExistentialProjection, ExistentialTraitRef, InferTy, ProjectionTy, Term, Ty, TyCtxt, TypeAndMut, }; use rustc_data_structures::fx::FxHashMap; use rustc_err...
use crate::actor_map::ActorMap; use crate::error::AutomergeError; use crate::internal::{InternalOpType, InternalOperation, InternalUndoOperation, ObjectID, OpID}; use crate::op::Operation; use crate::op_handle::OpHandle; use crate::op_set::OpSet; use crate::op_type::OpType; use crate::ordered_set::OrderedSet; use crate...