text
stringlengths
3.09k
13.9k
use std::convert::TryInto; use super::lossless::BitReader; use super::lossless::DecoderError; use crate::ImageResult; /// Rudimentary utility for reading Canonical Huffman Codes. /// Based off https://github.com/webmproject/libwebp/blob/7f8472a610b61ec780ef0a8873cd954ac512a505/src/utils/huffman.c /// const MAX_ALLOW...
// // Copyright 2020 The Project Oak Authors // // 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 o...
use crate::attribute_info::AttributeInfo; use crate::class_reader::ClassReader; use crate::constant_pool::ConstantPool; use crate::runtime_visible_annotations_attribute::ElementValue::*; use std::cell::{Ref, RefCell}; use std::rc::Rc; pub struct AnnotationsAttribute { cp: Rc<RefCell<ConstantPool>>, annotations...
use bdf_parser::{BdfFont, BoundingBox, Glyph, Property}; use embedded_graphics::{prelude::*, primitives::Rectangle}; use proc_macro::TokenStream; use proc_macro2::Span; use quote::quote; use std::{convert::TryFrom, fs, path::PathBuf}; use syn::{ parse::{Parse, ParseStream}, parse_macro_input, punctuated::Pu...
// Copyright (C) 2020 <NAME> <<EMAIL>> // Distributed under terms of the MIT license. mod dealer; mod game; mod hand; mod player; mod rules; mod shoe; mod strategy; #[macro_use] extern crate prettytable; use indicatif::{ProgressBar, ProgressStyle}; use prettytable::Table; use game::Game; use player::Player; use rul...
#![cfg_attr(not(feature = "std"), no_std)] //! Return the least-squares solution to a linear matrix equation //! //! The crate implements the linear least squares solution to a linear matrix //! equation. //! //! Characteristics: //! //! * Linear algebra and types from the [`nalgebra`](https://docs.rs/nalgebra) //! ...
use std::borrow::Cow; use std::ops::{DerefMut, Index}; use firestorm::profile_method; use serde::de; use crate::{de::PathDeserializer, Resource, ResourcePath}; #[derive(Debug, Clone)] pub(crate) enum PathItem { Static(Cow<'static, str>), Segment(u16, u16), } impl Default for PathItem { fn default() -> S...
use crate::sense::Sense; use std::convert::TryInto; /// SSC-4 Section 7.9 #[derive(Default, Debug)] pub struct ReportDensitySupport { pub medium_type: bool, pub media: bool, pub allocation_length: u16, } #[derive(Debug)] pub enum ReportDensitySupportOutput { Density(ReportDensitySupportOutputDensity), Mediu...
use crate::{ raw, peripherals::{ syscon::Syscon, adc::Adc, ctimer::Ctimer, }, typestates::{ init_state, } }; #[repr(align(16))] struct Descriptor{ transfer_config: u32, source_end_addr: u32, dest_end_addr: u32, next: u32, } #[repr(align(512))] struct...
use crate::error::*; use crate::il::Expression as Expr; use crate::il::*; use crate::translator::x86::x86register::{get_register, X86Register}; use falcon_capstone::capstone; use falcon_capstone::capstone::cs_x86_op; use falcon_capstone::capstone_sys::{x86_op_type, x86_reg}; /// Mode used by translators to pick the co...
#![allow(dead_code)] use std::default::Default; use std::future::Future; use std::pin::Pin; use std::task::Poll; use futures::channel::mpsc; use futures::channel::oneshot; use futures::executor::block_on; use futures::task::Context; use futures::{Stream, StreamExt}; use tokio::spawn; use tokio::task::JoinHandle; use...
extern crate gcc; extern crate filetime; use std::env; use std::ffi::OsString; use std::fs; use std::path::{PathBuf, Path}; use std::process::Command; use filetime::FileTime; macro_rules! t { ($e:expr) => (match $e { Ok(t) => t, Err(e) => panic!("{} return the error {}", stringify!($e), e), }...
use std::error::Error; use std::path::PathBuf; use fallible_iterator::FallibleIterator; use semver::Version; use simple_error::SimpleError; use structopt::StructOpt; use log::{warn, error}; use lazy_static::lazy_static; use crate::bumping::{Bump, BumpType}; use crate::changelog::{ChangeLog, TemplateType}; mod bumpin...
use futures; use futures::Future; use std; use std::io::{Read, Seek}; use std::sync::Arc; use std::os::unix::ffi::{OsStrExt, OsStringExt}; use crate::error::{ResultExt}; #[derive(Debug)] pub struct Root { title: String, path: std::path::PathBuf, } #[derive(Debug)] pub struct Object { root: Arc<Root>, path: std::...
// I'm a bit worried about the Dirac reference... // https://adventofcode.com/2021/day/21 use std::fmt; use std::collections::HashMap; // example inputs // static P1_start: u8 = 4; // static P2_start: u8 = 8; // real inputs static P1_start: u8 = 3; static P2_start: u8 = 4; struct State { space: u8, die: u8,...
use indexmap::set::IndexSet; /// Index into SourceAtomSet.atoms. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct SourceAtomSetIndex { index: usize, } impl SourceAtomSetIndex { fn new(index: usize) -> Self { Self { index } } } impl From<SourceAtomSetIndex> for usize { fn from(inde...
use crate::server::config::{Email}; use letterman_email_body_parser::{EmailBody,ContentDecoded,Part}; use json::{object,JsonValue,stringify}; use std::time::{SystemTime}; use crate::common::{sha256,random_string}; use tokio::fs::File; use tokio::io::AsyncWriteExt; // use tokio::sync::RwLock; // use std::sync::Arc; // u...
use super::*; use crate::count_parts; use flat_storage::FlatStorageFile as TorrentInfoFile; use serde::Deserialize; use crate::{BLOCK_SIZE, SHA1_SIZE}; /// Normalized info from torrent. #[derive(Debug, PartialEq, Clone, Deserialize)] pub struct TorrentInfo { pub piece_length: usize, pub default_blocks_count: ...
use crate::weight_functions::WeightFunctionInfo; use feos_core::{EosResult, HelmholtzEnergyDual, StateHD}; use ndarray::prelude::*; use ndarray::RemoveAxis; use num_dual::*; use num_traits::Zero; use std::fmt::Display; macro_rules! impl_helmholtz_energy { ($number:ty) => { impl HelmholtzEnergyDual<$number>...
// Any copyright is dedicated to the Public Domain. // http://creativecommons.org/publicdomain/zero/1.0/ //! A simple rkv demo that showcases the basic usage (put/get/delete) of rkv. //! //! You can test this out by running: //! //! cargo run --example simple-store use rkv::{ Manager, MultiStore, Rkv,...
/// Provides mostly direct binding to the HTTP API use std::cell::RefCell; use std::collections::HashMap; use std::fmt::Debug; use std::io::Read; use std::rc::Rc; use reqwest; use serde_json; use url; use super::data::*; use super::error::{TvdbError, TvdbResult}; use data::{EpisodeId, SeriesId}; /// Trait for custo...
//! # Pico USB Serial (with Interrupts) Example //! //! Creates a USB Serial device on a Pico board, with the USB driver running in //! the USB interrupt. //! //! This will create a USB Serial device echoing anything it receives. Incoming //! ASCII characters are converted to upercase, so you can tell it is working //!...
use crate::executor::loom::sync::atomic::AtomicUsize; use crate::executor::loom::sync::{Arc, Condvar, Mutex}; use crate::executor::park::{Park, Unpark}; use std::marker::PhantomData; use std::mem; use std::rc::Rc; use std::sync::atomic::Ordering; use std::task::{RawWaker, RawWakerVTable, Waker}; use std::time::Duratio...
use proc_macro2::Span; use super::{ ast::{ Alt, Call, Cat, Epsilon, Expression, Fix, Lambda, Let, Literal, NamedExpression, Variable, }, name::Name, }; pub trait Visitor { type Out; fn visit_epsilon(&mut self, name: Option<&Name>, span: Span, eps: &Epsilon) -> Self::Out; fn visit_lite...
#[macro_use] extern crate rswm; extern crate log; extern crate log4rs; extern crate x11; use std::os::raw::{c_uchar, c_uint}; use x11::{keysym, xlib}; use rswm::client::ClientW; use rswm::config::*; use rswm::core; use rswm::core::XWindowManager; use rswm::extra; use rswm::loggers; use rswm::layout::{Tile, Tile13, F...
//! The GPIO // Author: <NAME> // License: MIT use armv7::VirtualAddress; use core::marker::PhantomData; use register::{mmio::*, register_bitfields}; register_bitfields! { u32, REVISION [ MINOR OFFSET(0) NUMBITS(6) [], MAJOR OFFSET(8) NUMBITS(3) [] ], SYSCONFIG [ AUTOIDLE OFFS...
use super::*; fn make_op(args: &[&str]) -> JoshResult<Op> { match args { ["nop"] => Ok(Op::Nop), ["empty"] => Ok(Op::Empty), ["prefix", arg] => Ok(Op::Prefix(Path::new(arg).to_owned())), ["workspace", arg] => Ok(Op::Workspace(Path::new(arg).to_owned())), ["SQUASH"] => Ok(Op:...
use glium; use glium::index::PrimitiveType::*; use glium::texture::*; use glium::uniforms::*; use glium::*; use glutin::dpi::*; use glutin::*; use image::{load_from_memory_with_format, ImageFormat}; use runic::default_program; use resources::TILESET; use settings::Settings; const TITLE: &str = "War Against Machines";...
use crate::aoc::*; use log::debug; use serde::{Deserialize, Serialize}; use std::cmp::{Ordering, Reverse}; use std::collections::{BinaryHeap, HashMap, HashSet}; use std::convert::TryFrom; use std::error::Error; use std::sync::{Arc, RwLock}; use std::time::SystemTime; pub struct EventManager { leaderboard_ids: Vec<...
use crate::error::DeriveError; use crate::result::Result; use proc_macro2::Span; use syn::{spanned::Spanned, Ident, Path}; #[derive(Debug, PartialEq)] pub(crate) enum TypeHint { Join, Merge, Other, } pub(crate) struct TypeInfo { pub number_of_options: u8, pub type_hint: TypeHint, pub type_hint_...
#![forbid(unsafe_code)] #![forbid(clippy::all)] #![deny(clippy::pedantic)] #![deny(clippy::use_self)] #![forbid(clippy::needless_borrow)] //#![forbid(clippy::cognitive_complexity)] #![forbid(unreachable_pub)] #![forbid(elided_lifetimes_in_paths)] #![doc(html_root_url = "https://docs.rs/fend-core/0.1.19")] mod ast; mod...
// C S // -- VERS --> // <-- VERS --- // -- PROOF --> // <-- TXOUT -- // -- SIGS --> // <-- TXID --- use std::convert::TryFrom; use serde::{de, ser}; use serde::{Deserialize, Serialize}; use serde_json::json; pub use bitcoin; use bitcoin::consensus::{deserialize, serialize, Decodabl...
use ansi_term::Color::{Red, RGB}; use std::fs; #[derive(Debug)] struct BingoField { first_line: [i32; 5], second_line: [i32; 5], third_line: [i32; 5], fourth_line: [i32; 5], fifth_line: [i32; 5], } impl BingoField { fn new() -> BingoField { BingoField { first_line: [-1, -1,...
//! Environment variables and constatns. use crate::cuda::CudaArch; use cfg_if::cfg_if; use once_cell::sync::Lazy; use std::{ collections::HashSet, ffi::{OsStr, OsString}, path::{Path, PathBuf}, process::Command, }; /// The list of CUDA architectures given by `TORCH_CUDA_ARCH_LIST` environment variabl...
use std::thread; use std::collections::HashMap; use std::sync::mpsc::{Sender, Receiver}; use std::sync::mpsc; use std::sync::{Arc, Mutex}; use std::os::unix::net::{UnixStream, UnixListener}; use std::io::Write; use std::fs::remove_file; use std::vec::Vec; use common::*; macro_rules! SERVER_HELLO {() => ("Hello {}, you...
// Copyright 2021 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. //! The config module encapsulates the access to ffx_config //! and enables the mocking and faking of configuration to //! make the use of ffx_config test ...
use crate::access::{Aligned, MaybeUnaligned}; use crate::get_api; use crate::sys; use crate::GodotString; use crate::VariantArray; /// A vector of `GodotString` that uses Godot's pool allocator. pub struct StringArray(pub(crate) sys::godot_pool_string_array); pub type Read<'a> = Aligned<ReadGuard<'a>>; pub type Write...
use super::*; pub struct ServiceModule<'lua> { id: RefCell<Option<ServiceId>>, name: String, phone_number: Option<String>, role: ServiceRole, custom_price: Option<u32>, ringback_enabled: bool, required_sound_banks: Vec<String>, tbl_module: LuaTable<'lua>, func_load: Option<LuaFuncti...
#![allow(dead_code)] #[macro_use] mod macros; mod simulated_device; use simulated_device::SimulatedDevice; pub use simulated_device::{expected_slider_info, CodeSet, DeviceType, PortOption, LIST_LEN}; use smartcast::{Device, Error}; use tokio::time::{sleep, Sleep}; use std::future::Future; use std::pin::Pin; use st...
//! Implements backend functionality to spawn machines. use color_eyre::{eyre::WrapErr, Report}; use itertools::Itertools; use std::collections::HashMap; use std::future::Future; use std::pin::Pin; use tracing::instrument; use tracing_futures::Instrument; /// A description of a set of machines to launch. /// /// The ...
mod utils; use fixedbitset::FixedBitSet; use std::fmt; use wasm_bindgen::prelude::*; // A macro to provide `println!(..)`-style syntax for `console.log` logging. macro_rules! log { ( $( $t:tt )* ) => { #[allow(unused_unsafe)] unsafe { web_sys::console::log_1(&format!( $( $t )* ).into()...
#[macro_use] mod definitions; #[path = "./commands/build.rs"] mod command_build; #[path = "./commands/create.rs"] mod command_create; #[path = "./commands/destroy.rs"] mod command_destroy; #[path = "./commands/new.rs"] mod command_new; #[path = "./commands/platform.rs"] mod command_platform; #[path = "./utils/config...
use crate::mem::Zeroize; #[cfg(target_arch = "aarch64")] use core::arch::aarch64::*; use core::mem::transmute; #[inline] unsafe fn _mm_clmulepi64_si128(a: uint8x16_t, b: uint8x16_t, imm8: u8) -> uint8x16_t { match imm8 { 0x00 => { let a: u64 = vgetq_lane_u64(vreinterpretq_u64_u8(a), 0); ...
use glium; pub fn start_graphics(texture_size: u32, texture: Vec<u8>) { #[allow(unused_imports)] use glium::{glutin, Surface}; let start_time = std::time::Instant::now(); let event_loop = glutin::event_loop::EventLoop::new(); let wb = glutin::window::WindowBuilder::new() .with_inner_size(...
pub mod sampler; pub mod string; use rand::Rng; use std::f64::consts::PI; use lazy_static::lazy_static; use super::{ value::{Value, ValueNode}, Env, }; lazy_static! { static ref SINE: Vec<(f64, Vec<f64>)> = { let len = 512; vec![( 2200.0, (0..len) ...
// بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم // This file is part of Setheum. // Copyright (C) 2019-2021 Setheum Labs. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License a...
use main_error::MainError; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; use std::io::{stdout, Write}; use std::process::exit; use std::time::{SystemTime, UNIX_EPOCH}; #[derive(Debug, Deserialize, Serialize)] struct History { path: String, rank: f64, time: u64, } #[derive(Clone, Copy)] enum...
use std::path::Path; use std::sync::{Arc, Mutex}; use std::{fs::create_dir_all, path::PathBuf}; use anyhow::{bail, Context, Result}; use crossbeam_channel::{unbounded, Sender}; use log::{error, warn}; use pueue_lib::error::Error; use pueue_lib::network::certificate::create_certificates; use pueue_lib::network::messag...
extern crate x11; use std::collections::HashMap; use std::io::prelude::*; use std::io::BufReader; use std::io::Lines; use std::fs::File; use std::path::PathBuf; use std::process::Command; use std::ffi; use std::env; use x11::xlib; use std::boxed::Box; use super::layout::{self, LayoutDirection, MoveDirection}; use sup...
use std::collections::VecDeque; use std::iter::{Sum, ExactSizeIterator, Iterator}; // use std:: use itertools::Itertools; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use crate::{Track, Result, BEAT_CAP, LinearExt, LinearBeat}; // //////////////////////////////////////////////////////////////////////// // Recor...
#![forbid(unsafe_code)] #![deny(clippy::all)] use clap::{ArgEnum, Parser}; use yozuk_sdk::prelude::*; mod tld; pub const ENTRY: SkillEntry = SkillEntry { model_id: b"9Kr7qeDGzvzR8ph-ZyuQm", config_schema: None, init: |_, _| { Skill::builder() .add_translator(PunycodeTranslator) ...
#![recursion_limit = "128"] extern crate proc_macro; use proc_macro::TokenStream; use syn::{parse_macro_input, Ident, NestedMeta, Data, Fields, DeriveInput}; use itertools::Itertools; use quote::quote; use quote::ToTokens; // TODO: documentation #[proc_macro_derive(Measurement, attributes(influx))] pub fn derive_me...
// Copyright 2020-2021 <NAME> // SPDX-License-Identifier: Apache-2.0 //! Module describing the milestone payload. mod essence; mod milestone_id; pub use essence::{MilestonePayloadEssence, MILESTONE_MERKLE_PROOF_LENGTH, MILESTONE_PUBLIC_KEY_LENGTH}; pub use milestone_id::{MilestoneId, MILESTONE_ID_LENGTH}; use crate...
use std::fmt; use std::str::CharIndices; #[derive(Copy, Clone, Debug, PartialEq)] pub enum TokType { AssignmentWord, Word, Operator, EOF, } impl fmt::Display for TokType { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{:?}", self) } } #[derive(Copy, Clone, Debu...
use crate::core::object::Object; use crate::core::HitRecord; use crate::core::ScatterRecord; use crate::material::{Material, Visitor}; use crate::math::Ray; use crate::random; use crate::texture::Texture; use crate::types; use crate::types::{ColorRGB, ColorRGBA, FSize, Point3, TextureCoordinate}; use std::error::Error;...
use crate::types::{ Condition, ExtendedPointId, FieldCondition, Filter, HasIdCondition, IsEmptyCondition, Payload, PayloadField, Range as RangeCondition, ValuesCount, VectorElementType, }; use itertools::Itertools; use rand::seq::SliceRandom; use rand::Rng; use serde_json::{json, Value}; use std::ops::{Range, R...
#[path = "./order_models.rs"] pub mod models; use actix_web::http::{ StatusCode}; use diesel::prelude::*; use models::NewOrderItem; use models::{Order, OrderDetails, OrderItem, OrderItemDetails}; use std::collections::HashMap; use uuid::Uuid; /// Find order corresponding to given user_id and order_id. pub fn find_...
use std::{cell::RefCell, rc::Rc}; use crate::chunk::Chunk; use crate::result::Result; static SOURCE_INDEX: u8 = 0; pub type Segment = Vec<i64>; pub type Line = Vec<Segment>; pub type Mappings = Vec<Line>; #[derive(Debug)] pub struct Mapping { generated_code_line: u32, generated_code_column: u32, hires: bool, ...
use auth::AuthError; use base::BoxFuture; use serde::{de::DeserializeOwned, Serialize}; use user::{HasUserStorage, IsUserStorage}; /// Authentication method interface pub trait IsAuthMethod<S> where S: HasUserStorage, { /// Auth info type type AuthInfo: Serialize + Send + 'static; /// User identificat...
use crate::{api, api::EditSubmit, article::ArticlePath, serde::Oid, user_storage::UserAccount}; use git2::{IndexEntry, Repository, Signature}; use smallvec::SmallVec; use std::{convert::TryFrom, os::unix::prelude::*, time::SystemTime}; use tokio::sync::MutexGuard; trait IndexExt { fn new_for_path<P>(path: P, file_...
use crate::{ consts, diem::{self, Diem}, error::ApiError, filters::{handle, with_options}, options::Options, types::{ AccountIdentifier, Amount, Block, BlockIdentifier, BlockRequest, BlockResponse, Currency, Operation, OperationIdentifier, Transaction, TransactionIdentifier, ...
#![feature(nll)] extern crate termion; extern crate extra; mod grid; use termion::{async_stdin, clear, color, cursor, style}; use termion::raw::{IntoRawMode, RawTerminal}; use std::io::{self, Write, Read, Result}; use std::thread; use std::time; fn main() { let stdout = io::stdout(); let mut game = Game::n...
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use crate::PciFunction; use std::collections::HashMap; use std::option::Option; use std::sync::{Arc, Mutex}; use utils::byte_order::{read_le_u16, read_le_u32}; /// A Device can have implemented up to 8 Fu...
//! Most basic gaclen usage example. //! //! Draws a single quad without depth or culling. //! //! Please note, that because of screen-space coordinate mismatch between OpenGL and Vulkan the `up` coordinate is reversed. // Allow `shader!` macro to use this project's gaclen dependency. extern crate gaclen; mod shade...
use chrono::NaiveDate; use regex::Regex; use reqwest::blocking::Client; use reqwest::StatusCode; use scraper::{ElementRef, Html, Selector}; use std::error::Error; use std::thread::sleep; use std::time::Duration; use crate::tagger::matcher::Matcher; use crate::tagger::{parse_duration, MusicPlatform, TaggerConfig, Track...
use super::token::{Token, TokenKind}; use super::util::StrCursor; use radix_trie::Trie; use thiserror::Error; #[derive(Debug, Error)] pub enum ScannerError { #[error("Unterminated String")] UnterminatedString, #[error("Invalid Character")] InvalidCharacter, } pub struct Scanner<'a> { source: &'a ...
use std::{convert::{TryFrom, TryInto}, fmt::Display, num::ParseIntError, str::FromStr}; use crate::checksum::Relativity; /// Turns Result<Iterator, Error> into Iterator<Result<Iterator::Item, Error>> so that /// on Err, only the single error is iterated, and else the items of the iterator pub(crate) fn unresult_iter<...
//! Functions for dealing with textual character data. use std::fmt::{self, Write}; use std::iter::FusedIterator; /// Matches the most common definition of whitespace in SGML: /// ASCII space, tab, newline, and carriage return. (`" \t\r\n"`) /// /// This definition does not include other Unicode whitespace characters...
use crate::astraw::RawInstr; pub fn parse_instr_seq(src_code: &str) -> Result<Vec<RawInstr>, Vec<ParsingError>> { // A scope is either the whole program or a bracket loop and its content. // Only the bottom scope isn't a bracket loop (and thus doesn't have an opening bracket pos), // this bottom scope should always...
/* * This example re-creates the "Fitting a Model to Data" example from the emcee documentation: * * http://dan.iel.fm/emcee/current/user/line/#example-fitting-a-model-to-data */ extern crate emcee; extern crate rand; use std::fs::File; use std::io::{BufWriter, Write}; use rand::distributions::{IndependentSample,...
use anyhow::Result; use std::ops::Deref; use crate::fst_properties::FstProperties; use crate::fst_traits::MutableFst; use crate::semirings::Semiring; use crate::Tr; use crate::{Label, StateId, EPS_LABEL}; /// Struct used to map final weights when performing a transition mapping. /// It will always be of the form `(EP...
/* * Copyright Amazon.com, Inc. or its affiliates. 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 * * Unless ...
use super::*; use crate::node_info::NodeContact; use crate::packet::AuthResponse; use enr::{CombinedKey, NodeId}; use zeroize::Zeroize; #[derive(Zeroize, PartialEq)] pub(crate) struct Keys { /// The Authentication response key. auth_resp_key: [u8; 16], /// The encryption key. encryption_key: [u8; 16],...
use proc_macro::TokenStream as StdTokenStream; use proc_macro2::{Ident, Span, TokenStream}; use quote::quote; use syn::{parse_macro_input, LitStr}; use crate::input::{ArgumentInput, CommandInput}; mod input; mod utils; macro_rules! metavar { ($ty:ty; $s:expr) => { <$ty>::new($s, Span::call_site()) };...
use anyhow::{anyhow, Result}; use itertools::Itertools; use lunatic::net::TcpStream; use serde::{Deserialize, Serialize}; use std::io::{Read, Write}; const IAC: u8 = 255; const WILL: u8 = 251; const WONT: u8 = 252; const DO: u8 = 253; const DONT: u8 = 254; const SE: u8 = 240; const SB: u8 = 250; const ECHO: u8 = 1;...
// Copyright (c) Viable Systems and TezEdge Contributors // SPDX-License-Identifier: MIT use ocaml_interop::{ ocaml_export, ocaml_unpack_polymorphic_variant, ocaml_unpack_variant, OCaml, OCamlBytes, OCamlFloat, OCamlInt, OCamlInt32, OCamlInt64, OCamlList, OCamlRef, ToOCaml, }; use std::{thread, time}; enum Mo...
// "Tifflin" Kernel // - By <NAME> (thePowersGang) // // Core/vfs/mod.rs //! Virtual File System use prelude::*; use vfs; use super::{mount, node}; use metadevs::storage::VolumeHandle; use lib::{VecMap,SparseVec}; use lib::byte_str::{ByteStr,ByteString}; use lib::mem::aref::{Aref,ArefInner,ArefBorrow}; pub struct Driv...
//! A simple tool for creating a new nannou project. //! //! 1. Determines whether the user is just sketching or wants an App (with model and event `fn`s). //! 2. Asks for a sketch/app name. extern crate names; extern crate rand; use std::env; use std::io::{self, BufRead, Write}; use std::fs::{self, File}; use std::p...
//! Implementation of a DataFusion `TableProvider` in terms of `PartitionChunk`s use std::sync::Arc; use arrow_deps::{ arrow::datatypes::SchemaRef as ArrowSchemaRef, datafusion::{ datasource::{ datasource::{Statistics, TableProviderFilterPushDown}, TableProvider, }, ...
use quote::{quote, quote_spanned}; use syn::spanned::Spanned; use syn::{parse, parse_macro_input}; /// This macro helps to run an example in the project's `examples/` directory using a development /// server. /// /// # Usage /// /// * In the file `examples/my_example.rs`, create your example: /// /// ```rust,ignore ...
use super::{Doc, LangService, TPos16}; use crate::{ cps::*, lang_service::{ doc_analysis::DocContentAnalysisMut, lang_service::{collect_def_sites, hit_test, Content, SymbolOccurrence}, }, source::TPos, token::{tokenize, TokenKind}, }; use std::{ io::{self, Write}, rc::Rc, }; ...
// Copyright 2017 Databricks, Inc. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writi...
#[allow(unused_imports)] use log::{debug, error, info, trace, warn}; use wgpu::util::DeviceExt; use winit::window::Window; pub mod rot_primitives; use crate::rot_primitives::Object; use rot_primitives::{Camera, DepthBufferTexture, Material, Mesh, Vertex}; pub mod rot_pipeline; use nalgebra as na; pub struct Rende...
use chrono::{offset::Utc, DateTime, NaiveDateTime}; use fnv::FnvHashMap as HashMap; use libquavertrack::db_util::{self, models::DBStatsUpdate}; use rocket::http::Status; use rocket_contrib::json::Json; use tokio::task::block_in_place; use crate::models::GetScoresResponse; use crate::DbConn; fn stringify_diesel_err(er...
use serde_json::*; use web_sys::{HtmlCanvasElement, CanvasRenderingContext2d}; use yew::{Component, ComponentLink, Html, ShouldRender}; use wasm_bindgen::JsCast; use wasm_bindgen::prelude::*; pub fn map() { let map = include_str!("map.json"); let json : Value = serde_json::from_str(map).unwrap(); let json = json.ge...
use std::fs::{read_to_string, File}; #[cfg(test)] use std::io::Read; use std::io::Write; use serde::{Deserialize, Serialize}; use specs::error::NoError; use specs::prelude::*; use specs::saveload::{DeserializeComponents, MarkedBuilder, SerializeComponents, SimpleMarker, SimpleMarkerAllocator}; use specs_derive::Compon...
use std::path::{Path, PathBuf}; use petgraph::prelude::*; use petgraph::visit::{Topo, Walker}; use buildkit_llb::prelude::*; use crate::config::{BaseImageConfig, Config}; use crate::graph::{Node, NodeCommand, NodeCommandDetails, NodeKind, PrimitiveNodeKind}; use crate::shared::{tools, CONTEXT, CONTEXT_PATH, TARGET_P...
// Copyright 2021 - <NAME> <<EMAIL>> // SPDX-License-Identifier: Apache-2.0 use crate::network_monitor::monitor::preparer::TestedNode; use crypto::asymmetric::identity; use std::convert::{TryFrom, TryInto}; use std::fmt::{self, Display, Formatter}; use std::hash::{Hash, Hasher}; use std::mem; use std::str::Utf8Error; ...
#[cfg(test)] mod tests; use std::borrow::Cow; use std::ffi::{CStr, CString, OsStr}; use std::fs::File; use std::io; use std::mem::MaybeUninit; use std::os::raw::{c_char, c_int}; use std::path::Path; use std::ptr::NonNull; use std::sync::atomic; use std::sync::{Mutex, Once}; use sensors_sys::*; use crate::errors::{Er...
use crate::ball::Ball; use crate::draw::{draw_rectangle, draw_text}; use crate::paddle::{Direction, Paddle}; use piston_window::{types::Color, Context, G2d, Glyphs, Key}; const BORDER_COLOR: Color = [1.0, 1.0, 1.0, 1.0]; const GAMEOVER_COLOR: Color = [0.80, 0.0, 0.0, 0.5]; const MARGIN_TOP: f64 = 5.0; const MOVING_PE...
use super::lexer::*; use super::*; use std::rc::Rc; pub struct Parser { pub tokens: Vec<Token>, pub top: usize, } impl Parser { pub fn new(tokens: Vec<Token>) -> Self { Parser { tokens, top: 0, } } pub fn parse(&mut self) -> ResResult<Vec<Statement>> { ...
use std::{ collections::{BinaryHeap, HashSet}, ops::Deref, str::FromStr, }; use strum::{EnumIter, IntoEnumIterator}; /// Represents a position in the maze: (row, col) type State = (usize, usize); #[derive(Debug, EnumIter)] enum Direction { North, East, South, West, } #[derive(Debug)] enu...
// Copyright (C) 2020 Mangata team #![cfg_attr(not(feature = "std"), no_std)] /// Edit this file to define custom logic or remove it if it is not needed. /// Learn more about FRAME and the core library of Substrate FRAME pallets: /// https://substrate.dev/docs/en/knowledgebase/runtime/frame use frame_support::{ c...
#[macro_use] extern crate serde_derive; extern crate serde; extern crate serde_json; use std::fs::OpenOptions; use std::env; use std::io::prelude::*; use std::process::Command; use std::path::PathBuf; use std::error::Error; use std::fmt; #[derive(Clone,Debug,PartialEq,Serialize, Deserialize)] pub struct Config { ...
use crate::ball::{Ball, BALL_RADIUS_ANGLE, NO_TEAM}; use crate::player::{ClientId, Player, SeqNr}; use crate::protocol::ClientMoveUpdate; use crate::room::{CIRCLE_RADIUS, FIELD_HEIGHT, FIELD_WIDTH, TPF, TPS}; use crate::util::positive_angle_wrap; use crate::vector::Vector; use smallvec::SmallVec; use static_assertions:...
// Copyright 2021 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any late...
#![feature(panic_info_message)] #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use directories::*; use ez_audio::*; use single_instance::SingleInstance; use std::panic; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex, RwLock}; use web_view::*; mod audio_clip; mod player; ...
use crate::{Captures, ReverseMatch, Segment}; use smartstring::alias::String as SmartString; use std::{ cmp::Ordering, convert::TryFrom, fmt::{self, Debug, Display, Formatter}, iter, str::FromStr, }; /// Routefinder's representation of the parsed route /// /// This contains both an optional source ...
use std::borrow::Cow; use proc_macro2::Span; use syn::parse; #[derive(Debug, PartialEq)] pub(super) enum FormatArgType { Debug { pretty: bool }, Display, } #[derive(Debug, PartialEq)] pub(super) enum Piece<'a> { Arg { arg_type: FormatArgType, implicit_capture: Option<&'a str>, }, ...
// * This file is part of the uutils coreutils package. // * // * (c) <NAME> <<EMAIL>> // * (c) <NAME> <<EMAIL>> // * // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. /* last synced with: cat (GNU coreutils) 8.13 */ // spell-chec...