text
stringlengths
3.09k
13.9k
use std::{ io::Cursor, sync::{Arc, atomic::{AtomicU64, Ordering}} }; use ton_block::{Deserializable, ShardIdent, Message, AccountIdPrefixFull}; use ton_types::{Result, types::UInt256, deserialize_tree_of_cells, fail}; const MESSAGE_LIFETIME: u32 = 600; // seconds const MESSAGE_MAX_GENERATIONS: u8 = 2; const M...
use std::usize; use chrono::{DateTime, Duration, Utc}; use thiserror::Error; use crate::{ serialization::{TrustedPreallocate, MAX_PROTOCOL_MESSAGE_LEN}, work::{difficulty::CompactDifficulty, equihash::Solution}, }; use super::{merkle, Hash, Height}; #[cfg(any(test, feature = "proptest-impl"))] use proptest_...
//! Provides functions for determining the paths of files and directories //! in a standard Volta layout in Windows operating systems. use std::io; #[cfg(windows)] use std::os::windows; use std::path::{Path, PathBuf}; use crate::error::ErrorDetails; use cfg_if::cfg_if; use dirs; use volta_fail::Fallible; use super::...
use crate::platform::prelude::*; use base64::{display::Base64Display, STANDARD}; use core::{ ops::Deref, sync::atomic::{AtomicUsize, Ordering}, }; use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; #[cfg(test)] mod tests; #[cfg(all(feature = "std", feature = "image-shrinking"))] mod shrinking;...
use rustc::mir::visit::{PlaceContext, Visitor}; use rustc::mir::{Local, Location, ReadOnlyBodyAndCache}; use rustc_data_structures::vec_linked_list as vll; use rustc_index::vec::IndexVec; use crate::util::liveness::{categorize, DefUse}; use crate::borrow_check::region_infer::values::{PointIndex, RegionValueElements};...
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use super::{ checkpoint::{Checkpoint, Park, Unpark}, state::{IdPool, RefVec}, stream::{ReceiveStream, SendStream, Stream}, Client, Endpoint, Local, Remote, Scope, Server, }; use crate::operation...
/*! # stm32f3xx-hal `stm32f3xx-hal` contains a multi device hardware abstraction on top of the peripheral access API for the STMicro [STM32F3][stm] series microcontrollers. The selection of the MCU is done by [feature][f] gates [f]: #selecting-the-right-chip [stm]: https://www.st.com/en/microcontrollers-micropr...
//! Scope testing use toc_hir::symbol::LocalDefId; use super::ScopeTracker; #[derive(Default)] struct LocalDefAlloc { next_id: u32, } impl LocalDefAlloc { pub fn next(&mut self) -> LocalDefId { let id = self.next_id; self.next_id += 1; LocalDefId::new(id) } } fn assert_declared()...
use crate::ty::query::Providers; use crate::hir::def_id::DefId; use crate::hir; use crate::ty::TyCtxt; use syntax_pos::symbol::Symbol; use rustc_target::spec::abi::Abi; use crate::hir::map::blocks::FnLikeNode; use syntax::attr; impl<'tcx> TyCtxt<'tcx> { /// Whether the `def_id` counts as const fn in your current c...
use std::{ io::{ Read, Cursor, Seek, SeekFrom, }, }; use byteorder::{ LittleEndian, ReadBytesExt, }; use crate::{ resource::fbx::{ document::{ FbxNodeContainer, FbxDocument, FbxNode, attribute::FbxAttribute, ...
// Copyright 2013-2017, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <https://opensource.org/licenses/MIT> // TODO: support marshaller. use std::mem; use std::ptr; use std::slice; use libc::{c_uint...
use super::{MethodType, DataType, MTFn, MTFnMut, MTSync, MethodResult, MethodInfo}; use super::{Tree, ObjectPath, Interface, Property, Signal, Method}; use super::objectpath::IfaceCache; use std::sync::Arc; use crate::strings::{Interface as IfaceName, Member}; use crate::{Path, arg}; use std::cell::RefCell; /// The fa...
//! UART driver, cc26xx family use core::cell::Cell; use gpio; use ioc; use kernel; use kernel::common::regs::{ReadOnly, ReadWrite, WriteOnly}; use kernel::hil::gpio::Pin; use kernel::hil::uart; use prcm; const UART_BASE: usize = 0x4000_1000; const MCU_CLOCK: u32 = 48_000_000; #[repr(C)] struct Registers { dr: Re...
use bendy::{ decoding::{self, FromBencode, Object}, encoding::{self, SingleItemEncoder, ToBencode}, }; use chrono::{DateTime, TimeZone, Utc}; use crate::{error::Error, info::Info}; #[derive(Debug, PartialEq, Eq)] pub struct MetaInfo { announce: String, info: Info, announce_list: Option<Vec<Vec<Str...
extern crate sfml; extern crate box2d; extern crate time; use sfml::system::Vector2f; use sfml::window::{ContextSettings, VideoMode, event, window_style}; use sfml::graphics::{RenderWindow, RenderTarget, CircleShape, Color, Vertex, Shape, Transformable, Lines, LinesStrip, VertexArray}; use box2d::world::World; use bo...
use aoc_runner_derive::{aoc, aoc_generator}; use std::collections::HashMap; #[aoc_generator(day15)] fn parse_input(input: &str) -> Vec<i32> { input .split(',') .map(|l| l.to_string().parse::<i32>().unwrap()) .collect() } #[aoc(day15, part1)] fn part1(stanza: &[i32]) -> i32 { let mut em...
use crate::{error::MongoError, vacuum_cursor, BsonTransform}; use datamodel::dml::PrismaValue; use itertools::Itertools; use mongodb::{ bson::{from_bson, Bson, Document}, options::*, }; use prisma_models::ModelRef; use std::collections::HashMap; #[allow(clippy::large_enum_variant)] pub enum MongoCommand { ...
use font_kit::family_name::FamilyName; use font_kit::loaders::freetype::Font; use font_kit::properties::Properties; use font_kit::source::SystemSource; use raqote::SolidSource; use super::Config; use crate::desktop::{IconConfig, DEFAULT_THEME}; use crate::draw::{BgParams, InputTextParams, ListParams}; use crate::icon:...
#![cfg_attr(not(feature = "std"), no_std)] // Disable the following two lints since they originate from an external macro (namely decl_storage) #![allow(clippy::string_lit_as_bytes)] use frame_support::{ decl_error, decl_event, decl_module, decl_storage, ensure, traits::Get, weights::constants::WEIGHT_PER_MICROS, It...
use super::super::dir::{Dir, Entry, SeekLoc}; use super::osfile::OsFile; use crate::old::snapshot_0::hostcalls_impl::{Dirent, PathGet}; use crate::old::snapshot_0::sys::host_impl; use crate::old::snapshot_0::sys::unix::str_to_cstring; use crate::old::snapshot_0::{wasi, Error, Result}; use log::trace; use std::convert::...
extern crate image; extern crate imageproc; extern crate nalgebra; extern crate pico_detect; use image::{GrayImage, Rgb, RgbImage}; use imageproc::drawing; use imageproc::rect::Rect; use nalgebra::{Point2, Point3}; use pico_detect::{create_xorshift_rng, CascadeParameters, Detector, Localizer, Shaper}; use std::include...
use std::collections::VecDeque; use parquet2::{encoding::Encoding, page::DataPage, schema::Repetition}; use crate::{ array::Offset, bitmap::MutableBitmap, datatypes::DataType, error::Result, io::parquet::read::DataPages, }; use super::super::nested_utils::*; use super::super::utils::MaybeNext; use super::bas...
use crate::{parser::*, AmlContext, AmlError}; pub const NULL_NAME: u8 = 0x00; pub const DUAL_NAME_PREFIX: u8 = 0x2E; pub const MULTI_NAME_PREFIX: u8 = 0x2F; pub const ROOT_CHAR: u8 = b'\\'; pub const PREFIX_CHAR: u8 = b'^'; pub const RESERVED_FIELD: u8 = 0x00; pub const ACCESS_FIELD: u8 = 0x01; pub const CONNECT_FIEL...
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
//! Display an interactive 2D XY Pad that controls two [`Param`] parameters at //! once. One in the `x` coordinate and one in the `y` coordinate. //! //! [`Param`]: ../core/param/trait.Param.html use crate::core::Normal; use crate::native::xy_pad; use iced_graphics::{Backend, Primitive, Renderer}; use iced_native::{mo...
//! Compute the transitive reduction and closure of a directed acyclic graph //! //! ## Transitive reduction and closure //! The *transitive closure* of a graph **G = (V, E)** is the graph **Gc = (V, Ec)** //! such that **(i, j)** belongs to **Ec** if and only if there is a path connecting //! **i** to **j** in **G**. ...
//! Heavy Console - a simple, easy to use, and robust command line built on Egui, hv-gui, hv-lua, //! hv-resources, and hv-script. //! //! The main type is [`Console`], which stores the state of the main text buffers and command //! history, and also provides functionality for queuing and running commands w/ a //! [`Sc...
use std::{fmt::Display, time::SystemTime}; use chrono::{DateTime, Datelike, FixedOffset, Local, NaiveDateTime, TimeZone, Utc}; use log::*; use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Serialize, Deserialize)] pub enum ModifierType { #[serde(rename = "epoch_to_iso")] EpochToISO,...
use std::sync::Mutex; use indicatif::ProgressBar; use itertools::Itertools; use rayon::prelude::*; use crate::{canvas::Canvas, matrix::Matrix, ray::Ray, tuple::Tuple, world::World}; #[derive(Debug)] pub struct Camera { pub hsize: usize, pub vsize: usize, pub field_of_view: f64, pub transform: Matrix,...
use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::Path; use std::str::FromStr; use std::sync::Arc; use failure::ResultExt; use log::info; use serde::Deserialize; use snips_nlu_ontology::Language; use crate::entity_parser::{CachingBuiltinEntityParser, Cachin...
//! A mix of injectivity and disjointness, without selectors use { std::hash::Hash, batsmt_core::{ast_u32::AST, backtrack::{Backtrackable, HashMap as BHMap}}, batsmt_pretty as pp, crate::{ cc::{self, MicroTheory, MicroTheoryArg, NodeID, }, Ctx, pp_t, ConstructorView as CView, HasConstr...
use crate::*; use error::SniprunError; use interpreter::{Interpreter, SupportLevel}; use std::io::prelude::*; use std::process::Command; use std::{fs::File, io::Read}; pub struct Launcher { pub data: DataHolder, } impl Launcher { pub fn new(data: DataHolder) -> Self { Launcher { data } } pub ...
use std::usize; use crate::{ bitboard::Bitboard, defs::{Piece, Side, Square}, magic::{Magic, BISHOP_TABLE_SIZE, ROOK_TABLE_SIZE}, }; mod defs; mod generate; mod init; mod mask; pub mod movelist; #[derive(Debug, Clone, PartialEq)] pub struct MoveGenerator { white_pawns: Vec<Bitboard>, ...
use euclid::default::SideOffsets2D; use ropey::{Rope, RopeSlice}; use std::{borrow::Cow, cmp, iter}; use zee_highlight::SelectorNodeId; use zi::{ terminal::GraphemeCluster, Canvas, Component, ComponentLink, Layout, Position, Rect, ShouldRender, Size, }; use crate::{ components::cursor::{CharIndex, Cursor},...
use codespan::{ByteIndex, Span}; use logos::Logos; use super::{ raw_lexer::{CommentKind, Token}, text_lexer::Text, }; use crate::error::LexicalError; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct Comment<'input> { pub span: Span, pub kind: CommentKind, pub content: &'input str, } #[deri...
use phala_crypto::ecdh::EcdhPublicKey; use phala_mq::traits::MessageChannel; use runtime::BlockNumber; use serde::{Deserialize, Serialize}; use super::pink::cluster::ClusterKeeper; use super::*; use crate::secret_channel::SecretReceiver; use crate::types::BlockInfo; use phala_serde_more as more; pub struct ExecuteEnv...
// Copyright (c) The dgc.network // SPDX-License-Identifier: Apache-2.0 use std::fs::File; use std::io::prelude::*; use std::io::BufReader; use std::path::Path; use std::path::PathBuf; use dgc_contract_sdk::protocol::payload::{ Action, CreateContractActionBuilder, SmartPayload, SmartPayloadBuilder, }; use sawtoot...
use super::framed::Fuse; use super::Decoder; use tokio_io::AsyncRead; use bytes::BytesMut; use futures_core::Stream; use futures_sink::Sink; use log::trace; use std::fmt; use std::pin::Pin; use std::task::{Context, Poll}; /// A `Stream` of messages decoded from an `AsyncRead`. pub struct FramedRead<T, D> { inner...
use cosmwasm_std::{ to_binary, CanonicalAddr, CosmosMsg, DepsMut, Env, MessageInfo, Response, Storage, Uint128, WasmMsg, }; use cw20::Cw20ExecuteMsg; use terraswap::querier::query_token_balance; use crate::error::ContractError; use crate::executions::ExecuteResult; use crate::states::bank::TokenManager; use cr...
// rng.rs // Random number generator using VirtIO // <NAME> // 16 March 2020 #![allow(dead_code)] use crate::{kmem::{kfree, kmalloc}, page::{zalloc, PAGE_SIZE}, virtio, virtio::{Descriptor, MmioOffsets, Queue, StatusField, VIRTIO_RING_SIZE}}; use core::{mem::size_of, ptr::null_mut};...
use crate::bencher::protocol::Throughput; /// Trait providing functions to format measured values to string so that they can be displayed on /// the command line or in the reports. The functions of this trait take measured values in f64 /// form; implementors can assume that the values are of the same scale as those p...
mod kmer; use crayfish::collective; use crayfish::finish; use crayfish::place; use crayfish::place::world_size; use crayfish::logging::*; use crayfish::place::Place; use crayfish::shared::PlaceLocal; use crayfish::shared::PlaceLocalWeak; use std::collections::hash_map::DefaultHasher; use std::fs::File; use std::hash::...
// Copyright 2020 <NAME> // SPDX-License-Identifier: Apache-2.0 #[cfg(feature = "dashboard")] use crate::plugins::dashboard::config::{DashboardConfig, DashboardConfigBuilder}; use crate::plugins::mqtt::config::{MqttConfig, MqttConfigBuilder}; use bee_common::logger::{LoggerConfig, LoggerConfigBuilder}; use bee_ledge...
// 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...
use crate::{ event::{PathComponent, PathIter}, sinks::util::encoding::{EncodingConfig, EncodingConfiguration, TimestampFormat}, }; use serde::{ de::{self, DeserializeOwned, Deserializer, IntoDeserializer, MapAccess, Visitor}, Deserialize, Serialize, }; use std::{ fmt::{self, Debug}, marker::Phan...
use crate::StrError; /// Computes the number of divisions for GridSearch /// /// Note: **long** means the longest direction whereas /// **other** corresponds to the `not-long` directions. /// /// ```text /// ndiv_other = truncate((delta_other/delta_long) * ndiv_long) /// ndiv_other = max(ndiv_min, ndiv_other) //...
use std::{ thread, process::ExitStatus, sync::{Arc, RwLock} }; use anyhow::Error; use futures::{select, pin_mut, join, future::FutureExt}; use tokio::{ process::{Child, ChildStdout, ChildStderr}, runtime::Builder, io::{BufReader, AsyncBufReadExt} }; use chrono::Utc; use crate::{ model::{ ...
//! Implementations of DekuRead and DekuWrite for tuples of length 1 to 11 use crate::{DekuError, DekuRead, DekuWrite}; use bitvec::prelude::*; // Trait to help us build intermediate tuples while DekuRead'ing each element // from the tuple trait Append<T> { type NewType; fn append(self, new: T) -> Self::NewT...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. use core::{ convert::TryFrom, fmt::{Debug, Display}, ops::{ Add, AddAssign, BitAnd, Div, DivAssign, Mul, MulAssign, Ne...
use interface::fill::fill; use klv::klv::*; use klv::ul::*; use klv::value::*; use klv::value::element::Element; use klv::value::value_data::*; use klv::value::partition::PartitionStatus::*; use std::io::prelude::*; use std::io::Cursor; use serializer::encoder::*; #[derive(Debug, Copy, Clone)] #[repr(C)] pub enum Co...
use gettextrs::gettext; use gstreamer as gst; use gstreamer::PadExt; use gstreamer::prelude::*; use glib; use glib::ObjectExt; use std::collections::HashSet; use std::error::Error; use std::path::Path; use std::sync::mpsc::Sender; use super::ContextMessage; pub struct TocSetterContext { pipeline: gst::Pipeline...
//! Shader backend interface. //! //! This interface defines the low-level API shaders must implement to be usable. //! //! Shader support is quite complex and requires several concepts to be implemented by the backend. The first one is the //! concept of « shader stage ». A shader stage represents a single logic of sh...
mod display_string; mod messages; mod stateful_list; mod visualization_helpers; mod visualizator_app; use std::{ error::Error, io, time::{Duration, Instant}, }; use log::LevelFilter; use log4rs::{ append::console::ConsoleAppender, config::{Appender, Root}, Config, }; use messages::{DataUpdate, RosCommand}...
use std::fmt; use regex::Regex; #[derive(Debug, PartialEq)] pub enum Error { NoTagFound, MisformedInput, } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Error::NoTagFound => write!(f, "Expected a tag"), Error::Misform...
use std::io; use std::mem; use winapi::shared::minwindef::FILETIME; use winapi::shared::winerror::NO_ERROR; use winapi::um::errhandlingapi::GetLastError; use winapi::um::fileapi::{ BY_HANDLE_FILE_INFORMATION, GetFileInformationByHandle, GetFileType, }; use winapi::um::winnt; use AsHandleRef; /// Return vario...
//! Provides the Current Pace Component and relevant types for using it. The //! Current Pace Component is a component that shows a prediction of the current //! attempt's final time, if the current attempt's pace matches the chosen //! comparison for the remainder of the run. use super::key_value; use crate::{ an...
// This file is part of the uutils coreutils package. // // (c) <NAME> <<EMAIL>> // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. // spell-checker:ignore (strings) ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUV // spell-checker:ignore ...
//! card-validate detects and validates credit card numbers (type of card, number length and //! Luhn checksum). #[macro_use] extern crate lazy_static; extern crate regex; use regex::Regex; use std::ops::Range; mod luhn; // The card formats have been copied from: https://github.com/faaez/creditcardutils/\ // blob...
use crate::{ machines::WorkflowMachines, protos::temporal::api::enums::v1::EventType, protos::temporal::api::history::v1::{History, HistoryEvent}, }; #[derive(Clone, Debug, derive_more::Constructor, PartialEq)] pub(crate) struct HistoryInfo { pub previous_started_event_id: i64, pub workflow_task_st...
use crate::cmd::Cmd; use clap::{Parser, ValueHint}; use ethers::contract::MultiAbigen; use eyre::WrapErr; use foundry_config::{ figment::{ self, error::Kind::InvalidType, value::{Dict, Map, Value}, Metadata, Profile, Provider, }, impl_figment_convert, Config, }; use serde::S...
mod interval; use anyhow::{bail, Error, Result}; use log::trace; use serde::Deserialize; use std::io; use std::net::{SocketAddr, ToSocketAddrs}; use std::path::PathBuf; use tokio::fs::File; use tokio::io::AsyncReadExt; pub(crate) use self::interval::SaveInterval; async fn read_config_file() -> io::Result<Vec<u8>> { ...
mod avd; mod batfish; mod gitlab; mod nautobot; use log::{debug, info}; use nautobot::Data::Ipaddress; use nautobot::{IPAddress, Nautobot, Query, WebhookRequest}; use std::env; use std::str; use warp::Filter; #[derive(Debug)] pub enum Error { YAMLError(serde_yaml::Error), JSONError(serde_json::Error), Com...
use eframe::{egui, epi}; use egui_stylist::{StylistFileDialog, StylistState}; use std::fs::File; use std::io::Read; #[cfg(not(target_arch = "wasm32"))] use std::io::Write; use std::path::PathBuf; // fn open_error_window(ctx: &egui::CtxRef, title: &str, text: &str, open: &mut bool) { // let window = egui::Window::n...
use std::panic::catch_unwind; use crate::{NatureError, Result, SEPARATOR_INS_PARA}; pub fn append_para(para: &str, part: &str) -> String{ if para.is_empty() { return part.to_string(); } if part.is_empty() { return para.to_string(); } para.to_string() + &SEPARATOR_INS_PARA + part ...
/** * [146] LRU Cache * * * Design and implement a data structure for <a href="https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU" target="_blank">Least Recently Used (LRU) cache</a>. It should support the following operations: get and put. * * * * get(key) - Get the value (will always be positive...
//! A RAL-like module to support DMA register access //! //! The RAL has TONS of symbols for DMA. The script that auto-generates //! the RAL from a SVD file doesn't represent register clusters as an array //! of structs. The transfer control descriptions, in particularly, could //! conveniently be represented by 32 TCD...
//! Defines different distance metrics, in simplest case it defines the //! euclidean distance which is no more than the square root of the sum of the //! squares of the distances in each dimension. use num_traits::Float; use itertools::{iproduct, Itertools, MinMaxResult}; #[cfg(any(target_arch = "x86_64"))] use std:...
mod opcodes; use crate::{ CHIP8, WINDOW_W, WINDOW_H, load_binary_file }; use std::io; // Start-Up, program loading and screen updating impl CHIP8 { pub fn new(args: Option<&[String]>) -> io::Result<CHIP8> { let mut program_path = None; match args { Some(a) => { if a.len() < 2 { return Err(io::Error:...
// Copyright 2017 <NAME> (IRCAM) // 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 wri...
use super::{output_film, Film, Renderer}; use crate::camera::Camera; use crate::config::{Config, IntegratorKind, RendererType, Resolution}; // use crate::hittable::Hittable; use crate::integrator::gpu_style::*; // use crate::materials::*; use crate::math::*; // use crate::profile::Profile; // use crate::spectral::BOUN...
//! Contains a framework for the processing of discrete Tasks, as well as //! various implementations of it for installer-related tasks. use std::fmt; use std::fmt::Display; use crate::installer::InstallerFramework; use crate::sources::types::File; use crate::sources::types::Version; pub mod download_pkg; pub mod e...
use crate::app::{App, AppSorting, AppStage}; use tui::backend::Backend; use tui::layout::{Alignment, Constraint, Direction, Layout, Rect}; use tui::style::{Color, Modifier, Style}; use tui::widgets::{Block, Borders, List, ListItem, ListState, Paragraph, Wrap}; use tui::Frame; pub struct ListLayout<'a> { pub layout...
use proc_macro::TokenStream; use quote::{quote, ToTokens}; struct DebugField<T: ToTokens> { named: T, format: Option<String>, } fn get_associated_type<'a>(t: &'a syn::Type, generics: &syn::Generics) -> Option<&'a syn::Path> { if let syn::Type::Path(syn::TypePath { path, .. }) = t { let segments = ...
mod conflicts; pub mod prelude; mod server; use chrono::{DateTime, Utc}; use crate::error::Error; use crate::models::{Delta, TimeEntry}; use crate::toggl_api::{models::Id, TogglApi}; use prelude::{SyncOutcome, SyncResult}; pub fn fetch_snapshot(api: &TogglApi) -> Result<Delta, Error> { server::fetch_changes_sinc...
#[cfg(any( all(feature = "noise", feature = "tls"), all(not(feature = "noise"), not(feature = "tls")) ))] fn main() {} #[cfg(any( all(feature = "noise", not(feature = "tls")), all(not(feature = "noise"), feature = "tls") ))] #[async_std::main] async fn main() -> anyhow::Result<()> { use anyhow::Res...
#[cfg(feature = "px8_plugin_lua")] extern crate px8_plugin_lua; #[cfg(feature = "cpython")] #[macro_use] extern crate cpython; extern crate sdl2; extern crate getopts; extern crate chiptune; extern crate nalgebra; extern crate image; extern crate gif; extern crate regex; extern crate png; extern crate byteorder; ...
use super::aacoordinatetransformation; use super::aa3dcoordinate; pub fn correction_in_longitude(longitude: f64, latitude: f64, jd: f64) -> f64 { let t = (jd - 2451545.0) / 36525.0; let mut ldash = longitude - 1.397 * t - 0.00031 * t * t; //Convert to radians ldash = aacoordinatetransformatio...
#![cfg_attr(not(feature = "std"), no_std)] use frame_support::{ decl_event, decl_module, decl_storage, traits::{Currency, ExistenceRequirement, Get, WithdrawReasons}, }; use sp_runtime::{ traits::{CheckedConversion, SaturatedConversion}, RuntimeDebug, }; use sp_std::{ convert::{TryInto, TryFrom}, ...
use super::Contest; use reqwest::blocking::Client; use serde::Deserialize; use std::collections::{HashMap, HashSet}; use std::convert::{TryFrom, TryInto}; // TODO: remove this import after 2021 edition use std::iter::FromIterator; // TODO: remove this import after 2021 edition /// General response from the Codeforces ...
#[macro_use] extern crate log; extern crate async_std; mod traceroute; mod consume; use std::thread; use std::collections::HashMap; use std::net::Ipv4Addr; use std::sync::mpsc::SyncSender; use lib_data::{AppData, ReceiverChannel, AppTcp, AppTraceRoute, AppTraceRouteTask}; pub type CommMessage = (u8, Vec<u8>); pub ...
mod vec3; use vec3::{Color, Point3, Vec3}; mod color; mod ray; use ray::Ray; mod hittable; use hittable::Hittable; mod sphere; use sphere::Sphere; mod hittable_list; use hittable_list::HittableList; mod camera; use camera::Camera; mod material; use material::Material; mod lambertian; use lambertian::Lambertian; ...
#![allow(dead_code)] use std::{env, path::PathBuf}; struct Environment { host: String, emit_debug_info: bool, target_compiler: Option<String>, target_os: String, target_env: Option<String>, mode: String, static_crt: bool, } struct Context { root: PathBuf, builder: cc::Build, e...
use crate::hab_core::package::PackageTarget; use habitat_builder_db::models::{jobs::{JobExecState, JobGraphEntry, NewJobGraphEntry}, package::BuilderPackageTarget}; use chrono::{DateTime, Dura...
use async_graphql::connection::{query, Connection, Edge, EmptyFields}; use async_graphql::{Context, Enum, Object, Result, SimpleObject}; use super::HrcLgbtq2020; #[derive(SimpleObject, Clone)] pub(crate) struct Score { pub(crate) kind: ScoreKind, pub(crate) description: String, } #[derive(Enum, Copy, Clone, ...
//! Check make results use super::*; use anyhow::Result; use std::{ collections::HashSet, fs, hash::Hash, io::{self, BufRead}, path::*, }; /// Parse compiler linker flags, `-L` and `-l` /// /// - Search paths defined by `-L` will be removed if not exists, /// and will be canonicalize /// /// ```...
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; use rustc_middle::ty::{self, Ty}; use rustc_span::{self, Span}; use super::Expectation::*; use super::FnCtxt; /// When type-checking an expression, we propagate downward /// whatever type hint we are able in the form of an `Expectati...
use std::io; // If _not_ using PidNewProcess you must configure an executable to start with // heap logging by creating a registry entry like: // [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\svchost.exe] // "TracingFlags"=dword:00000001 // // First enable the NT kernel ...
// CITA // Copyright 2016-2019 Cryptape Technologies LLC. // This program 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 // later version. // Th...
use std::fs::File; use std::fs::metadata; use std::io::{Read, Write, BufReader, BufWriter, BufRead}; use std::env; use std::time::Instant; use std::path::Path; // Convenience functions for buffered IO --------------------------- fn write(buf_out: &mut BufWriter<File>, output: &[u8]) { buf_out.write(output).unwrap(...
use crate::new_network::{ ConnectionCommand, DataCommand, Network, PeerId, Protocol, ALEPH_PROTOCOL_NAME, ALEPH_VALIDATOR_PROTOCOL_NAME, }; use codec::Codec; use futures::{channel::mpsc, StreamExt}; use log::{debug, error, trace, warn}; use sc_network::{multiaddr, Event, NotificationSender}; use std::{ borr...
use crate::{gm_artifacts, input::RunKind, RunOptions}; use heck::ToTitleCase; use indicatif::ProgressBar; use std::{io::BufRead, io::BufReader, path::Path, process::Child}; pub struct CompilerHandler { state: CompilerState, is_build: bool, } enum CompilerState { Initialize, Compile(Vec<String>), ...
/* * Copyright (c) Meta Platforms, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use std::io::ErrorKind; use std::pin::Pin; use async_trait::async_trait; use bytes::Bytes; use futures::{Stream, StreamExt};...
extern crate es_data; use self::es_data::datatypes::Sparse; /// Copy the data from one sparse vector to another pub fn copy_anchor(from: &Sparse, to: &mut Sparse) -> () { to.0 = from.0; to.1.truncate(0); to.2.truncate(0); to.1.extend_from_slice(&from.1); to.2.extend_from_slice(&from.2); } /// Com...
use address::Address; use env; use error::Error; use log_entry::LogEntry; use parser; use primitive_types::U256; use provider::Provider; use runtime::Runtime; use schedule::Schedule; use state::State; use transaction::{Action, Transaction}; use types::{ActionParams, ActionType}; use utils; use wasm_cost::WasmCosts; #[...
#[macro_use] extern crate text_io; extern crate chrono; use chrono::{NaiveDateTime, Timelike}; use std::collections::HashMap; use std::env; use std::fs::File; use std::io; use std::io::BufRead; fn main() { let args = env::args().collect::<Vec<String>>(); if args.len() < 3 { panic!("Not enough argument...
use kdtree::kdtree::*; use {Point, Road, RoadType, RoadMap, RoadError}; use config::Config; use rules; use rand::{thread_rng, Rng}; use std::collections::VecDeque; impl Point { pub fn new(x: f64, y: f64) -> Point { Point { pos: [x, y] } } pub fn out_of_range() -> Point { Point { pos: [-1.;...
use cargo_metadata::MetadataCommand; use std::env; use std::process::{self, Command, Stdio}; use std::str::FromStr; use clap::Parser; #[derive(Debug)] enum CargoCommand { Build, Check, Run, Test, } impl From<CargoCommand> for &'static str { fn from(cmd: CargoCommand) -> &'static str { matc...
extern crate proc_macro; use proc_macro::TokenStream; use proc_macro2::{Ident, Span}; use quote::quote; use syn::{Item as SynItem, ItemFn}; #[proc_macro_attribute] pub fn plugin_transform( _args: proc_macro::TokenStream, input: proc_macro::TokenStream, ) -> proc_macro::TokenStream { let token = proc_macro2...
use abi_stable::{ abi_stability::abi_checking::{check_layout_compatibility, AbiInstability}, type_layout::TypeLayout, StableAbi, }; #[cfg(feature = "const_params")] mod with_const_generics; mod one_phantom { use abi_stable::{const_utils::AssocStr, marker_type::UnsafeIgnoredType}; #[repr(C)] #...
use crate::about::about; use crate::handle; use crate::posts::posts; use crate::site_info::site_info; use std::cell::RefCell; use std::rc::Rc; use web_sys::ScrollToOptions; #[derive(Debug, Clone, PartialEq)] pub enum ContentType { Home, About, Posts, SiteInfo, Github, LinkedIn, } impl Default f...