file_name large_stringlengths 4 69 | prefix large_stringlengths 0 26.7k | suffix large_stringlengths 0 24.8k | middle large_stringlengths 0 2.12k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
peers.rs | // Copyright 2021 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0 | // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.... | // | random_line_split |
peers.rs | // Copyright 2021 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... | (&self, column: PeerColumn) -> String {
// Converts optional size to human readable size
fn size_to_string(size: u64) -> String {
size.file_size(CONVENTIONAL)
.unwrap_or_else(|_| "-".to_string())
}
match column {
PeerColumn::Address => self.addr.clone(),
PeerColumn::State => self.state.clone(),
... | to_column | identifier_name |
peers.rs | // Copyright 2021 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... | LinearLayout::new(Orientation::Horizontal)
.child(TextView::new("Longest Chain: "))
.child(TextView::new(" ").with_name("longest_work_peer")),
)
.child(TextView::new(" "))
.child(
Dialog::around(table_view.with_name(TABLE_PEER_STATUS).min_size((50, 20)))
.title("Connected Peer... | let table_view = TableView::<PeerStats, PeerColumn>::new()
.column(PeerColumn::Address, "Address", |c| c.width_percent(16))
.column(PeerColumn::State, "State", |c| c.width_percent(8))
.column(PeerColumn::UsedBandwidth, "Used bandwidth", |c| {
c.width_percent(16)
})
.column(PeerColumn::Direction, "Dir... | identifier_body |
monomorphized-callees-with-ty-params-3314.rs | // Copyright 2012 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-MIT or ... | <S:Serializer>(&self, s: S) {
self.a.serialize(s);
}
}
impl Serializer for int {
}
pub fn main() {
let foo = F { a: 1 };
foo.serialize(1i);
let bar = F { a: F {a: 1 } };
bar.serialize(2i);
}
| serialize | identifier_name |
monomorphized-callees-with-ty-params-3314.rs | // Copyright 2012 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 |
#[feature(managed_boxes)];
trait Serializer {
}
trait Serializable {
fn serialize<S:Serializer>(&self, s: S);
}
impl Serializable for int {
fn serialize<S:Serializer>(&self, _s: S) { }
}
struct F<A> { a: A }
impl<A:Serializable> Serializable for F<A> {
fn serialize<S:Serializer>(&self, s: S) {
... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms. | random_line_split |
monomorphized-callees-with-ty-params-3314.rs | // Copyright 2012 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-MIT or ... |
}
impl Serializer for int {
}
pub fn main() {
let foo = F { a: 1 };
foo.serialize(1i);
let bar = F { a: F {a: 1 } };
bar.serialize(2i);
}
| {
self.a.serialize(s);
} | identifier_body |
results.rs | use std::collections::{HashMap, HashSet};
use super::automata::State;
use rustc_serialize::{Encoder, Encodable};
use ::{Node, NodeIndex, Edge, GraphDB, Graph, PropVal};
use std::hash::{Hash, Hasher};
pub struct MatchResult<'a> {
parent_lookup: HashMap<NodeIndex, Vec<(NodeIndex, &'a Edge)>>,
finished_nodes: Has... | });
self.add_node_to_row(parent, rows, index);
}
}
fn reverse_rows(&self, rows: Vec<ResultRow>) -> Vec<ResultRow> {
let mut new_rows = Vec::new();
for row in rows {
if row.tail.len() == 0 {
new_rows.push(row)
} else {
... | random_line_split | |
results.rs | use std::collections::{HashMap, HashSet};
use super::automata::State;
use rustc_serialize::{Encoder, Encodable};
use ::{Node, NodeIndex, Edge, GraphDB, Graph, PropVal};
use std::hash::{Hash, Hasher};
pub struct MatchResult<'a> {
parent_lookup: HashMap<NodeIndex, Vec<(NodeIndex, &'a Edge)>>,
finished_nodes: Has... | }).collect()
} else {
vec![]
}
}
}
#[cfg(test)]
mod test {
use ::{GraphDB, Edge, NodeIndex, Graph};
use super::{ResultRow, EdgeNode};
#[test]
fn result_set_rust_influenced_by() {
fn check_row(rows: &Vec<ResultRow>, g: &GraphDB, end_node: NodeIndex) {
let my_row = Resu... | {
None
} | conditional_block |
results.rs | use std::collections::{HashMap, HashSet};
use super::automata::State;
use rustc_serialize::{Encoder, Encodable};
use ::{Node, NodeIndex, Edge, GraphDB, Graph, PropVal};
use std::hash::{Hash, Hasher};
pub struct MatchResult<'a> {
parent_lookup: HashMap<NodeIndex, Vec<(NodeIndex, &'a Edge)>>,
finished_nodes: Has... | {
node: Node,
connected_to: HashMap<NodeIndex, Edge>,
}
impl<'a> MatchResult<'a> {
pub fn new(parent_lookup: HashMap<NodeIndex, Vec<(NodeIndex, &'a Edge)>>, finished_nodes: HashSet<State>, graph: &'a GraphDB) -> MatchResult<'a> {
MatchResult {
parent_lookup: parent_lookup,
... | DAGNode | identifier_name |
lib.rs | // VST2 plugin for Boucle.
//
// Following: https://vaporsoft.net/creating-an-audio-plugin-with-rust-vst/
// Docs: https://docs.rs/vst/0.2.1/vst/
#[cfg(feature = "vst")]
pub mod boucle_vst {
#[macro_use]
extern crate vst;
use vst::api::Events;
use vst::buffer::AudioBuffer;
use vst::event::Event;
use vst::plugin::{Ca... |
fn process_events(&mut self, events: &Events) {
for event in events.events() {
match event {
Event::Midi(ev) => {
println!("Got MIDI event: {}.", ev.data[0]);
},
_ => (),
}
}
}
fn process(&mut self... | {
Info {
name: "Boucle".to_string(),
vendor: "Medium Length Life".to_string(),
unique_id: 42,
inputs: 2,
outputs: 2,
version: 1,
category: Category::Effect,
..Default::default()
}
} | identifier_body |
lib.rs | // VST2 plugin for Boucle.
//
// Following: https://vaporsoft.net/creating-an-audio-plugin-with-rust-vst/
// Docs: https://docs.rs/vst/0.2.1/vst/
#[cfg(feature = "vst")]
pub mod boucle_vst {
#[macro_use]
extern crate vst;
use vst::api::Events;
use vst::buffer::AudioBuffer;
use vst::event::Event;
use vst::plugin::{Ca... | ;
type VstSample = f32;
impl Plugin for BoucleVst {
fn get_info(&self) -> Info {
Info {
name: "Boucle".to_string(),
vendor: "Medium Length Life".to_string(),
unique_id: 42,
inputs: 2,
outputs: 2,
version: 1,
category: Cate... | BoucleVst | identifier_name |
lib.rs | // VST2 plugin for Boucle.
//
// Following: https://vaporsoft.net/creating-an-audio-plugin-with-rust-vst/
// Docs: https://docs.rs/vst/0.2.1/vst/
#[cfg(feature = "vst")]
pub mod boucle_vst {
#[macro_use]
extern crate vst;
use vst::api::Events;
use vst::buffer::AudioBuffer;
use vst::event::Event;
use vst::plugin::{Ca... | let (_input_buffer, mut output_buffer) = buffer.split();
for output_channel in output_buffer.into_iter() {
for output_sample in output_channel {
*output_sample = 0f32;
}
}
}
}
plugin_main!(BoucleVst);
} | }
}
}
fn process(&mut self, buffer: &mut AudioBuffer<VstSample>) { | random_line_split |
parsers.rs | use regex;
use models;
lazy_static! {
static ref CARD_UPDATE_PATTERN: regex::Regex = regex::Regex::new(
r"^.*id=(?P<id>\d*).*cardId=(?P<card_id>[a-zA-Z0-9_]*).*player=(?P<player>\d*)")
.unwrap();
static ref GAME_COMPLETE_PATTERN: regex::Regex = regex::Regex::new(
r".*TAG_CHANGE Entit... |
CARD_UPDATE_PATTERN
.captures(line)
.and_then(|group| {
let id = group.name("id").map(|m| m.as_str());
let card_id = group.name("card_id").map(|m| m.as_str());
let player = group.name("player").map(|m| m.as_str());
match (id, card_id, player) {
... | {
return Some(LogEvent::GameComplete);
} | conditional_block |
parsers.rs | use regex;
use models;
lazy_static! {
static ref CARD_UPDATE_PATTERN: regex::Regex = regex::Regex::new(
r"^.*id=(?P<id>\d*).*cardId=(?P<card_id>[a-zA-Z0-9_]*).*player=(?P<player>\d*)")
.unwrap();
static ref GAME_COMPLETE_PATTERN: regex::Regex = regex::Regex::new(
r".*TAG_CHANGE Entit... | assert!(CARD_UPDATE_PATTERN.is_match(log_line));
}
} | random_line_split | |
parsers.rs | use regex;
use models;
lazy_static! {
static ref CARD_UPDATE_PATTERN: regex::Regex = regex::Regex::new(
r"^.*id=(?P<id>\d*).*cardId=(?P<card_id>[a-zA-Z0-9_]*).*player=(?P<player>\d*)")
.unwrap();
static ref GAME_COMPLETE_PATTERN: regex::Regex = regex::Regex::new(
r".*TAG_CHANGE Entit... | {
GameComplete,
PowerLogRecreated,
Play(models::Play),
}
pub fn parse_log_line(line: &str) -> Option<LogEvent> {
if GAME_COMPLETE_PATTERN.is_match(line) {
return Some(LogEvent::GameComplete);
}
CARD_UPDATE_PATTERN
.captures(line)
.and_then(|group| {
let id = ... | LogEvent | identifier_name |
monomorphize.rs | // Copyright 2012-2014 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... | use syntax::ast_util::local_def;
use syntax::attr;
use syntax::codemap::DUMMY_SP;
use std::hash::{Hasher, Hash, SipHasher};
pub fn monomorphic_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
fn_id: ast::DefId,
psubsts: &'tcx subst::Substs<'tcx>,
... | use syntax::ast; | random_line_split |
monomorphize.rs | // Copyright 2012-2014 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... | <'tcx,T>(tcx: &ty::ctxt<'tcx>,
param_substs: &Substs<'tcx>,
value: &T)
-> T
where T : TypeFoldable<'tcx> + HasTypeFlags
{
let substituted = value.subst(tcx, param_substs);
normalize_associated_type(tcx, &su... | apply_param_substs | identifier_name |
monomorphize.rs | // Copyright 2012-2014 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... | let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();
for obligation in obligations {
fulfill_cx.register_predicate_obligation(&infcx, obligation);
}
let result = drain_fulfillment_cx_or_panic(DUMMY_SP, &infcx, &mut fulfill_cx, &result);
result
}
| {
debug!("normalize_associated_type(t={:?})", value);
let value = erase_regions(tcx, value);
if !value.has_projection_types() {
return value;
}
// FIXME(#20304) -- cache
let infcx = infer::normalizing_infer_ctxt(tcx, &tcx.tables);
let mut selcx = traits::SelectionContext::new(&inf... | identifier_body |
messagebox.rs | use std::ffi::CString;
use std::ptr;
use video::Window;
use get_error;
use SdlResult;
use util::CStringExt;
use sys::messagebox as ll;
bitflags! {
flags MessageBoxFlag: u32 {
const MESSAGEBOX_ERROR = ll::SDL_MESSAGEBOX_ERROR,
const MESSAGEBOX_WARNING = ll::SDL_MESSAGEBOX_WARNING,
const ME... |
}
| {
Err(get_error())
} | conditional_block |
messagebox.rs | use std::ffi::CString;
use std::ptr;
use video::Window;
use get_error;
use SdlResult;
use util::CStringExt;
use sys::messagebox as ll;
bitflags! {
flags MessageBoxFlag: u32 {
const MESSAGEBOX_ERROR = ll::SDL_MESSAGEBOX_ERROR,
const MESSAGEBOX_WARNING = ll::SDL_MESSAGEBOX_WARNING,
const ME... | {
let result = unsafe {
let title = CString::new(title).remove_nul();
let message = CString::new(message).remove_nul();
ll::SDL_ShowSimpleMessageBox(flags.bits(),
title.as_ptr(),
message.as_ptr(),
... | identifier_body | |
messagebox.rs | use std::ffi::CString;
use std::ptr;
use video::Window;
use get_error;
use SdlResult;
use util::CStringExt;
use sys::messagebox as ll;
bitflags! {
flags MessageBoxFlag: u32 {
const MESSAGEBOX_ERROR = ll::SDL_MESSAGEBOX_ERROR,
const MESSAGEBOX_WARNING = ll::SDL_MESSAGEBOX_WARNING,
const ME... | (flags: MessageBoxFlag, title: &str, message: &str, window: Option<&Window>) -> SdlResult<()> {
let result = unsafe {
let title = CString::new(title).remove_nul();
let message = CString::new(message).remove_nul();
ll::SDL_ShowSimpleMessageBox(flags.bits(),
... | show_simple_message_box | identifier_name |
messagebox.rs | use std::ffi::CString;
use std::ptr;
use video::Window;
use get_error;
use SdlResult;
use util::CStringExt;
use sys::messagebox as ll;
bitflags! {
flags MessageBoxFlag: u32 {
const MESSAGEBOX_ERROR = ll::SDL_MESSAGEBOX_ERROR,
const MESSAGEBOX_WARNING = ll::SDL_MESSAGEBOX_WARNING,
const ME... | } | } else {
Err(get_error())
} | random_line_split |
htmlfontelement.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::dom::attr::Attr;
use crate::dom::bindings::codegen::Bindings::HTMLFontElementBinding;
use crate::dom::b... | .unwrap()
.parse_plain_attribute(name, value),
}
}
}
pub trait HTMLFontElementLayoutHelpers {
fn get_color(&self) -> Option<RGBA>;
fn get_face(&self) -> Option<Atom>;
fn get_size(&self) -> Option<u32>;
}
impl HTMLFontElementLayoutHelpers for LayoutDom<HTMLFontElem... | &local_name!("size") => parse_size(&value),
_ => self
.super_type() | random_line_split |
htmlfontelement.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::dom::attr::Attr;
use crate::dom::bindings::codegen::Bindings::HTMLFontElementBinding;
use crate::dom::b... | (&self) -> Option<&dyn VirtualMethods> {
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
}
fn attribute_affects_presentational_hints(&self, attr: &Attr) -> bool {
if attr.local_name() == &local_name!("color") {
return true;
}
// FIXME: Should also return t... | super_type | identifier_name |
htmlfontelement.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::dom::attr::Attr;
use crate::dom::bindings::codegen::Bindings::HTMLFontElementBinding;
use crate::dom::b... | ParseMode::RelativePlus
},
Some(&'-') => {
let _ = input_chars.next(); // consume the '-'
ParseMode::RelativeMinus
},
Some(_) => ParseMode::Absolute,
};
// Steps 6, 7, 8
let mut value = match read_numbers(input_chars) {
(Some(v), _... | {
let original_input = input;
// Steps 1 & 2 are not relevant
// Step 3
input = input.trim_matches(HTML_SPACE_CHARACTERS);
enum ParseMode {
RelativePlus,
RelativeMinus,
Absolute,
}
let mut input_chars = input.chars().peekable();
let parse_mode = match input_char... | identifier_body |
metadata.rs | use std::collections::HashMap;
use std::str;
use crypto::sha1::Sha1;
use crypto::digest::Digest;
use bencode::{Bencode, TypedMethods, BencodeToString};
#[derive(Clone, Debug)]
pub struct | {
length: i64,
md5sum: Option<Vec<u8>>
}
#[derive(Clone, Debug)]
pub struct FileInfo {
length: i64,
md5sum: Option<Vec<u8>>,
path: Vec<String>
}
#[derive(Clone, Debug)]
pub struct MultiFileInfo {
files: Vec<FileInfo>
}
#[derive(Clone, Debug)]
pub enum FileMode {
SingleFile(SingleFileInfo... | SingleFileInfo | identifier_name |
metadata.rs | use std::collections::HashMap;
use std::str;
use crypto::sha1::Sha1;
use crypto::digest::Digest;
use bencode::{Bencode, TypedMethods, BencodeToString};
#[derive(Clone, Debug)]
pub struct SingleFileInfo {
length: i64,
md5sum: Option<Vec<u8>>
}
#[derive(Clone, Debug)]
pub struct FileInfo {
length: i64,
... | md5sum: info_dict.get_owned_string("md5sum")})
};
//for now only handle single file mode
Some(Metadata {
announce: str::from_utf8(&announce).unwrap().to_string(),
info_hash: info_hash,
piece_length: info_dict.get_int("piece length").unwrap_or_... | {
let announce = self.get_string("announce").unwrap_or_else(||panic!("no key found for announce"));
let info_dict = self.get_dict("info").unwrap_or_else(||panic!("no key found for info")).to_owned();
let mut sha = Sha1::new();
let info_as_text = Bencode::Dict(info_dict.clone()).to_bencod... | identifier_body |
metadata.rs | use std::collections::HashMap;
use std::str;
use crypto::sha1::Sha1;
use crypto::digest::Digest;
use bencode::{Bencode, TypedMethods, BencodeToString};
#[derive(Clone, Debug)]
pub struct SingleFileInfo {
length: i64,
md5sum: Option<Vec<u8>>
}
#[derive(Clone, Debug)]
pub struct FileInfo {
length: i64,
... | pub fn get_total_length (&self) -> u32 {
let len = match self.mode_info {
FileMode::SingleFile(ref sf) => sf.length,
FileMode::MultiFile(ref mf) => mf.files.iter().fold(0, |a:i64, b:&FileInfo| a + b.length)
};
len as u32
}
}
fn to_file_list (list: &Vec<Bencode>) ... | mode_info: FileMode,
}
impl Metadata { | random_line_split |
apps.rs | // Copyright 2019 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTI... | (client: &AuthClient, app_id: String) -> Box<AuthFuture<()>> {
let client = client.clone();
let c2 = client.clone();
let c3 = client.clone();
let c4 = client.clone();
let app_id = app_id.clone();
let app_id2 = app_id.clone();
let app_id3 = app_id.clone();
config::list_apps(&client)
... | remove_revoked_app | identifier_name |
apps.rs | // Copyright 2019 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTI... | // If the app is not in the access container, or if the app entry has
// been deleted (is empty), then it's revoked.
let revoked = entries
.get(&key)
.map(|entry| entry.content.is_empty())
.unwrap_or(true);
... | random_line_split | |
sph_sha_test.rs | extern crate sphlib;
extern crate libc;
use sphlib::{sph_sha, utils};
#[test]
fn will_be_sha0_hash() {
let dest = sph_sha::sha0_init_load_close("");
let actual = utils::to_hex_hash(&dest);
assert_eq!("f96cea198ad1dd5617ac084a3d92c6107708c0ef", actual.to_string());
}
#[test]
fn will_be_sha1_hash() {
... |
#[test]
fn will_be_sha512_hash() {
let dest = sph_sha::sha512_init_load_close("");
let actual = utils::to_hex_hash(&dest);
assert_eq!("cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", actual.to_string());
}
| {
let dest = sph_sha::sha384_init_load_close("");
let actual = utils::to_hex_hash(&dest);
assert_eq!("38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", actual.to_string());
} | identifier_body |
sph_sha_test.rs | extern crate sphlib;
extern crate libc;
use sphlib::{sph_sha, utils};
#[test]
fn will_be_sha0_hash() {
let dest = sph_sha::sha0_init_load_close("");
let actual = utils::to_hex_hash(&dest);
assert_eq!("f96cea198ad1dd5617ac084a3d92c6107708c0ef", actual.to_string()); | let dest = sph_sha::sha1_init_load_close("");
let actual = utils::to_hex_hash(&dest);
assert_eq!("da39a3ee5e6b4b0d3255bfef95601890afd80709", actual.to_string());
}
#[test]
fn will_be_sha224_hash() {
let dest = sph_sha::sha224_init_load_close("");
let actual = utils::to_hex_hash(&dest);
asse... | }
#[test]
fn will_be_sha1_hash() { | random_line_split |
sph_sha_test.rs | extern crate sphlib;
extern crate libc;
use sphlib::{sph_sha, utils};
#[test]
fn will_be_sha0_hash() {
let dest = sph_sha::sha0_init_load_close("");
let actual = utils::to_hex_hash(&dest);
assert_eq!("f96cea198ad1dd5617ac084a3d92c6107708c0ef", actual.to_string());
}
#[test]
fn will_be_sha1_hash() {
... | () {
let dest = sph_sha::sha224_init_load_close("");
let actual = utils::to_hex_hash(&dest);
assert_eq!("d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", actual.to_string());
}
#[test]
fn will_be_sha256_hash() {
let dest = sph_sha::sha256_init_load_close("");
let actual = utils::to_he... | will_be_sha224_hash | identifier_name |
udiv128.rs | /// Multiply unsigned 128 bit integers, return upper 128 bits of the result
#[inline]
fn u128_mulhi(x: u128, y: u128) -> u128 {
let x_lo = x as u64;
let x_hi = (x >> 64) as u64;
let y_lo = y as u64;
let y_hi = (y >> 64) as u64;
// handle possibility of overflow
let carry = (x_lo as u128 * y_lo ... | let d = 10_000_000_000_000_000_000_u64; // 10^19
let quot = if n < 1 << 83 {
((n >> 19) as u64 / (d >> 19)) as u128
} else {
let factor =
(8507059173023461586_u64 as u128) << 64 | 10779635027931437427 as u128;
u128_mulhi(n, factor) >> 62
};
let rem = (n - quot * d a... | identifier_body | |
udiv128.rs | /// Multiply unsigned 128 bit integers, return upper 128 bits of the result
#[inline]
fn u128_mulhi(x: u128, y: u128) -> u128 {
let x_lo = x as u64;
let x_hi = (x >> 64) as u64;
let y_lo = y as u64;
let y_hi = (y >> 64) as u64;
// handle possibility of overflow
let carry = (x_lo as u128 * y_lo ... | }
/// Divide `n` by 1e19 and return quotient and remainder
///
/// Integer division algorithm is based on the following paper:
///
/// T. Granlund and P. Montgomery, “Division by Invariant Integers Using Multiplication”
/// in Proc. of the SIGPLAN94 Conference on Programming Language Design and
/// Implementatio... | let high2 = x_hi as u128 * y_lo as u128 + m_lo as u128 >> 64;
x_hi as u128 * y_hi as u128 + high1 + high2 | random_line_split |
udiv128.rs | /// Multiply unsigned 128 bit integers, return upper 128 bits of the result
#[inline]
fn u128_mulhi(x: u128, y: u128) -> u128 {
let x_lo = x as u64;
let x_hi = (x >> 64) as u64;
let y_lo = y as u64;
let y_hi = (y >> 64) as u64;
// handle possibility of overflow
let carry = (x_lo as u128 * y_lo ... | {
let factor =
(8507059173023461586_u64 as u128) << 64 | 10779635027931437427 as u128;
u128_mulhi(n, factor) >> 62
};
let rem = (n - quot * d as u128) as u64;
debug_assert_eq!(quot, n / d as u128);
debug_assert_eq!(rem as u128, n % d as u128);
(quot, rem)
}
| ((n >> 19) as u64 / (d >> 19)) as u128
} else | conditional_block |
udiv128.rs | /// Multiply unsigned 128 bit integers, return upper 128 bits of the result
#[inline]
fn u128_mulhi(x: u128, y: u128) -> u128 {
let x_lo = x as u64;
let x_hi = (x >> 64) as u64;
let y_lo = y as u64;
let y_hi = (y >> 64) as u64;
// handle possibility of overflow
let carry = (x_lo as u128 * y_lo ... | 28) -> (u128, u64) {
let d = 10_000_000_000_000_000_000_u64; // 10^19
let quot = if n < 1 << 83 {
((n >> 19) as u64 / (d >> 19)) as u128
} else {
let factor =
(8507059173023461586_u64 as u128) << 64 | 10779635027931437427 as u128;
u128_mulhi(n, factor) >> 62
};
... | d_1e19(n: u1 | identifier_name |
simple-tuple.rs | // Copyright 2013-2014 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... | () {()}
| zzz | identifier_name |
simple-tuple.rs | // Copyright 2013-2014 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... |
PADDING_AT_END = (116, 117);
}
zzz(); // #break
}
fn zzz() {()}
| {
let noPadding8: (i8, u8) = (-100, 100);
let noPadding16: (i16, i16, u16) = (0, 1, 2);
let noPadding32: (i32, f32, u32) = (3, 4.5, 5);
let noPadding64: (i64, f64, u64) = (6, 7.5, 8);
let internalPadding1: (i16, i32) = (9, 10);
let internalPadding2: (i16, i32, u32, u64) = (11, 12, 13, 14);
... | identifier_body |
simple-tuple.rs | // Copyright 2013-2014 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... | // gdb-command:print'simple-tuple::INTERNAL_PADDING_2'
// gdb-check:$6 = {12, 13, 14, 15}
// gdb-command:print'simple-tuple::PADDING_AT_END'
// gdb-check:$7 = {16, 17}
// gdb-command:run
// gdb-command:print/d noPadding8
// gdb-check:$8 = {-100, 100}
// gdb-command:print noPadding16
// gdb-check:$9 = {0, 1, 2}
// gd... |
// gdb-command:print 'simple-tuple::INTERNAL_PADDING_1'
// gdb-check:$5 = {10, 11} | random_line_split |
source_util.rs | // Copyright 2012-2013 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... | (cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
-> Box<base::MacResult+'static> {
base::check_zero_tts(cx, sp, tts, "file!");
let topmost = cx.expansion_cause();
let loc = cx.codemap().lookup_char_pos(topmost.lo);
let filename = token::intern_and_get_ident(&loc.file.name);
b... | expand_file | identifier_name |
source_util.rs | // Copyright 2012-2013 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... |
Err(_) => {
cx.span_err(sp,
&format!("{} wasn't a utf-8 file",
file.display()));
return DummyResult::expr(sp);
}
}
}
pub fn expand_include_bytes(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
... | {
// Add this input file to the code map to make it available as
// dependency information
let filename = format!("{}", file.display());
let interned = token::intern_and_get_ident(&src[..]);
cx.codemap().new_filemap(filename, src);
base::MacEager:... | conditional_block |
source_util.rs | // Copyright 2012-2013 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... | cx.codemap().new_filemap(filename, src);
base::MacEager::expr(cx.expr_str(sp, interned))
}
Err(_) => {
cx.span_err(sp,
&format!("{} wasn't a utf-8 file",
file.display()));
return DummyResult::expr(sp... | // dependency information
let filename = format!("{}", file.display());
let interned = token::intern_and_get_ident(&src[..]); | random_line_split |
stream_chain.rs | use tokio_stream::{self as stream, Stream, StreamExt};
use tokio_test::{assert_pending, assert_ready, task};
mod support {
pub(crate) mod mpsc;
}
use support::mpsc;
#[tokio::test]
async fn basic_usage() {
let one = stream::iter(vec![1, 2, 3]);
let two = stream::iter(vec![4, 5, 6]);
let mut stream = ... | drop(tx1);
assert_eq!(stream.size_hint(), (0, None));
assert!(stream.is_woken());
assert_eq!(Some(2), assert_ready!(stream.poll_next()));
assert_eq!(stream.size_hint(), (0, None));
drop(tx2);
assert_eq!(stream.size_hint(), (0, None));
assert_eq!(None, assert_ready!(stream.poll_next(... | assert_eq!(Some(1), assert_ready!(stream.poll_next()));
assert_pending!(stream.poll_next());
| random_line_split |
stream_chain.rs | use tokio_stream::{self as stream, Stream, StreamExt};
use tokio_test::{assert_pending, assert_ready, task};
mod support {
pub(crate) mod mpsc;
}
use support::mpsc;
#[tokio::test]
async fn basic_usage() {
let one = stream::iter(vec![1, 2, 3]);
let two = stream::iter(vec![4, 5, 6]);
let mut stream = ... | ;
impl tokio_stream::Stream for Monster {
type Item = ();
fn poll_next(
self: std::pin::Pin<&mut Self>,
_cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<()>> {
panic!()
}
fn size_hint(&self) -> (usize, Option<usize>) {
... | Monster | identifier_name |
tests.rs | //
// Copyright 2021 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... |
let rt = tokio::runtime::Runtime::new().unwrap();
let summary = bencher.bench(|bencher| {
bencher.iter(|| {
let request = Request {
body: br#"key_1"#.to_vec(),
};
let resp = rt
.block_on(wasm_handler.clone().handle_invoke(request))
... | {
let mut manifest_path = std::env::current_dir().unwrap();
manifest_path.push("Cargo.toml");
let wasm_module_bytes =
test_utils::compile_rust_wasm(manifest_path.to_str().expect("Invalid target dir"), true)
.expect("Couldn't read Wasm module");
let logger = Logger::for_test();
l... | identifier_body |
tests.rs | //
// Copyright 2021 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... | b"key_0".to_vec() => b"value_0".to_vec(),
b"key_1".to_vec() => b"value_1".to_vec(),
b"key_2".to_vec() => b"value_2".to_vec(),
b"empty".to_vec() => vec![],
}));
let policy = ServerPolicy {
constant_response_size_bytes: 100,
constant_processing_time_ms: 200,
};... | random_line_split | |
tests.rs | //
// Copyright 2021 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... |
}
| {
// `summary.mean` is in nanoseconds, even though it is not explicitly documented in
// https://doc.rust-lang.org/test/stats/struct.Summary.html.
let elapsed = Duration::from_nanos(summary.mean as u64);
// We expect the `mean` time for loading the test Wasm module and running its main f... | conditional_block |
tests.rs | //
// Copyright 2021 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... | () {
let server_port = test_utils::free_port();
let address = SocketAddr::from((Ipv6Addr::UNSPECIFIED, server_port));
let mut manifest_path = std::env::current_dir().unwrap();
manifest_path.push("Cargo.toml");
let wasm_module_bytes =
test_utils::compile_rust_wasm(manifest_path.to_str().exp... | test_server | identifier_name |
cast-rfc0401.rs | // Copyright 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-MIT or ... |
assert_eq!(0 as f64, 0f64);
assert_eq!(1 as f64, 1f64);
assert_eq!(l as f64, 9264081114510712022f64);
assert_eq!(l as i64 as f64, -9182662959198838444f64);
// float overflow : needs fixing
// assert_eq!(l as f32 as i64 as u64, 9264082620822882088u64);
// assert_eq!(l as i64 as f32 as i64, 91826640... | assert_eq!(l as i32 as isize as i32, l as i32);
assert_eq!(l as i64,-0x7f6f5f4f3f2f1f10); | random_line_split |
cast-rfc0401.rs | // Copyright 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-MIT or ... | {
H8=163,
Z=0,
X=256,
H7=67,
}
enum ValuedSigned {
M1=-1,
P1=1
}
fn main()
{
// coercion-cast
let mut it = vec![137].into_iter();
let itr: &mut vec::IntoIter<u32> = &mut it;
assert_eq!((itr as &mut Iterator<Item=u32>).next(), Some(137));
assert_eq!((itr as &mut Iterator<It... | Valued | identifier_name |
cast-rfc0401.rs | // Copyright 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-MIT or ... | identifier_body | ||
reachable-unnameable-type-alias.rs | // Copyright 2016 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-MIT or ... | () {}
| main | identifier_name |
reachable-unnameable-type-alias.rs | // Copyright 2016 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-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(staged_a... | random_line_split | |
reachable-unnameable-type-alias.rs | // Copyright 2016 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-MIT or ... |
fn main() {}
| {
0
} | identifier_body |
spiral-matrix.rs | use spiral_matrix::*;
#[test]
fn empty_spiral() {
let expected: Vec<Vec<u32>> = Vec::new();
assert_eq!(spiral_matrix(0), expected);
}
#[test]
#[ignore]
fn size_one_spiral() {
let expected: Vec<Vec<u32>> = vec![vec![1]];
assert_eq!(spiral_matrix(1), expected);
}
#[test]
#[ignore]
fn size_two_spiral() {... | ];
assert_eq!(spiral_matrix(3), expected);
}
#[test]
#[ignore]
fn size_four_spiral() {
let expected: Vec<Vec<u32>> = vec![
vec![1, 2, 3, 4],
vec![12, 13, 14, 5],
vec![11, 16, 15, 6],
vec![10, 9, 8, 7],
];
assert_eq!(spiral_matrix(4), expected);
}
#[test]
#[ignore]
fn ... | let expected: Vec<Vec<u32>> = vec![
vec![1, 2, 3],
vec![8, 9, 4],
vec![7, 6, 5], | random_line_split |
spiral-matrix.rs | use spiral_matrix::*;
#[test]
fn empty_spiral() |
#[test]
#[ignore]
fn size_one_spiral() {
let expected: Vec<Vec<u32>> = vec![vec![1]];
assert_eq!(spiral_matrix(1), expected);
}
#[test]
#[ignore]
fn size_two_spiral() {
let expected: Vec<Vec<u32>> = vec![vec![1, 2], vec![4, 3]];
assert_eq!(spiral_matrix(2), expected);
}
#[test]
#[ignore]
fn size_thre... | {
let expected: Vec<Vec<u32>> = Vec::new();
assert_eq!(spiral_matrix(0), expected);
} | identifier_body |
spiral-matrix.rs | use spiral_matrix::*;
#[test]
fn empty_spiral() {
let expected: Vec<Vec<u32>> = Vec::new();
assert_eq!(spiral_matrix(0), expected);
}
#[test]
#[ignore]
fn size_one_spiral() {
let expected: Vec<Vec<u32>> = vec![vec![1]];
assert_eq!(spiral_matrix(1), expected);
}
#[test]
#[ignore]
fn size_two_spiral() {... | () {
let expected: Vec<Vec<u32>> = vec![
vec![1, 2, 3, 4, 5],
vec![16, 17, 18, 19, 6],
vec![15, 24, 25, 20, 7],
vec![14, 23, 22, 21, 8],
vec![13, 12, 11, 10, 9],
];
assert_eq!(spiral_matrix(5), expected);
}
| size_five_spiral | identifier_name |
date.rs | use header::HttpDate;
header! {
#[doc="`Date` header, defined in [RFC7231](http://tools.ietf.org/html/rfc7231#section-7.1.1.2)"]
#[doc=""]
#[doc="The `Date` header field represents the date and time at which the"]
#[doc="message was originated."]
#[doc=""]
#[doc="# ABNF"]
#[doc="```plain"]
... | }
bench_header!(imf_fixdate, Date, { vec![b"Sun, 07 Nov 1994 08:48:37 GMT".to_vec()] });
bench_header!(rfc_850, Date, { vec![b"Sunday, 06-Nov-94 08:49:37 GMT".to_vec()] });
bench_header!(asctime, Date, { vec![b"Sun Nov 6 08:49:37 1994".to_vec()] }); | test_header!(test1, vec![b"Tue, 15 Nov 1994 08:12:31 GMT"]);
} | random_line_split |
lib.rs | //! Bindings for [QtGui](http://doc.qt.io/qt-5/qtgui-module.html) library.
//! | //! This crate was generated using [cpp_to_rust](https://github.com/rust-qt/cpp_to_rust).
//!
//! This is work in progress, so the API will significantly change in the future.
//! Some methods are missing, and some are inconvenient to use.
//! Some methods are unsafe even though they are not marked as unsafe.
//! Users... | random_line_split | |
enter_try.rs | // https://rustbyexample.com/error/multiple_error_types/enter_try.html
// http://rust-lang-ja.org/rust-by-example/error/option_with_result/enter_try.html
// Use `String` as our error type
type Result<T> = std::result::Result<T, String>;
fn double_first(vec: Vec<&str>) -> Result<i32> {
let first = try!(vec.first()... | (result: Result<i32>) {
match result {
Ok(n) => println!("The first doubled is {}", n),
Err(e) => println!("Error: {}", e),
}
}
fn main() {
let empty = vec![];
let strings = vec!["tofu", "93", "18"];
print(double_first(empty));
print(double_first(strings));
}
| print | identifier_name |
enter_try.rs | // https://rustbyexample.com/error/multiple_error_types/enter_try.html
// http://rust-lang-ja.org/rust-by-example/error/option_with_result/enter_try.html
// Use `String` as our error type
type Result<T> = std::result::Result<T, String>;
fn double_first(vec: Vec<&str>) -> Result<i32> {
let first = try!(vec.first()... |
fn main() {
let empty = vec![];
let strings = vec!["tofu", "93", "18"];
print(double_first(empty));
print(double_first(strings));
}
| {
match result {
Ok(n) => println!("The first doubled is {}", n),
Err(e) => println!("Error: {}", e),
}
} | identifier_body |
enter_try.rs | // https://rustbyexample.com/error/multiple_error_types/enter_try.html
// http://rust-lang-ja.org/rust-by-example/error/option_with_result/enter_try.html
// Use `String` as our error type
type Result<T> = std::result::Result<T, String>;
fn double_first(vec: Vec<&str>) -> Result<i32> {
let first = try!(vec.first()... | Ok(2 * value)
}
fn print(result: Result<i32>) {
match result {
Ok(n) => println!("The first doubled is {}", n),
Err(e) => println!("Error: {}", e),
}
}
fn main() {
let empty = vec![];
let strings = vec!["tofu", "93", "18"];
print(double_first(empty));
print(double_first(s... | .map_err(|e| e.to_string()));
| random_line_split |
gc.rs | // Copyright 2020 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | if let Some(mut these_apis) = by_typename.remove(&todo) {
todos.extend(these_apis.iter().flat_map(|api| api.deps()));
output.append(&mut these_apis);
} // otherwise, probably an intrinsic e.g. uint32_t.
done.insert(todo);
}
output
} | while !todos.is_empty() {
let todo = todos.remove(0);
if done.contains(&todo) {
continue;
} | random_line_split |
gc.rs | // Copyright 2020 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | continue;
}
if let Some(mut these_apis) = by_typename.remove(&todo) {
todos.extend(these_apis.iter().flat_map(|api| api.deps()));
output.append(&mut these_apis);
} // otherwise, probably an intrinsic e.g. uint32_t.
done.insert(todo);
}
output
}... | {
let mut todos: Vec<QualifiedName> = apis
.iter()
.filter(|api| {
let tnforal = api.typename_for_allowlist();
config.is_on_allowlist(&tnforal.to_cpp_name())
})
.map(Api::name)
.cloned()
.collect();
let mut by_typename: HashMap<QualifiedNam... | identifier_body |
gc.rs | // Copyright 2020 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | (
mut apis: Vec<Api<FnPhase>>,
config: &IncludeCppConfig,
) -> Vec<Api<FnPhase>> {
let mut todos: Vec<QualifiedName> = apis
.iter()
.filter(|api| {
let tnforal = api.typename_for_allowlist();
config.is_on_allowlist(&tnforal.to_cpp_name())
})
.map(Api::nam... | filter_apis_by_following_edges_from_allowlist | identifier_name |
gc.rs | // Copyright 2020 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... |
if let Some(mut these_apis) = by_typename.remove(&todo) {
todos.extend(these_apis.iter().flat_map(|api| api.deps()));
output.append(&mut these_apis);
} // otherwise, probably an intrinsic e.g. uint32_t.
done.insert(todo);
}
output
}
| {
continue;
} | conditional_block |
const-param-elided-lifetime.rs | // Elided lifetimes within the type of a const generic parameters is disallowed. This matches the
// behaviour of trait bounds where `fn foo<T: Ord<&u8>>() {}` is illegal. Though we could change
// elided lifetimes within the type of a const generic parameters to be'static, like elided
// lifetimes within const/static ... | // revisions: full min
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct A<const N: &u8>;
//~^ ERROR `&` without an explicit lifetime name cannot be used here
//[min]~^^ ERROR `&'static u8` is forbidden
trait B {}
impl<const N: &u8> A<N> {
//~^ ERROR `&` without an ex... | random_line_split | |
const-param-elided-lifetime.rs | // Elided lifetimes within the type of a const generic parameters is disallowed. This matches the
// behaviour of trait bounds where `fn foo<T: Ord<&u8>>() {}` is illegal. Though we could change
// elided lifetimes within the type of a const generic parameters to be'static, like elided
// lifetimes within const/static ... | <const N: &u8>;
//~^ ERROR `&` without an explicit lifetime name cannot be used here
//[min]~^^ ERROR `&'static u8` is forbidden
trait B {}
impl<const N: &u8> A<N> {
//~^ ERROR `&` without an explicit lifetime name cannot be used here
//[min]~^^ ERROR `&'static u8` is forbidden
fn foo<const M: &u8>(&self) {}
/... | A | identifier_name |
mod.rs | // Copyright 2014-2016 Johannes Köster.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Handling log-probabilities.
pub mod cdf;
use std::mem;
use std::f64;
use std::iter;
use std::ops::{Add, Sub, ... | Ok(Prob(p))
} else {
Err(ProbError::InvalidProb(p))
}
}
}
custom_derive! {
/// A newtype for log-scale probabilities.
///
/// # Example
///
/// ```
/// #[macro_use]
/// extern crate approx;
/// # extern crate bio;
/// # fn main() {
//... | impl Prob {
pub fn checked(p: f64) -> Result<Self, ProbError> {
if p >= 0.0 && p <= 1.0 { | random_line_split |
mod.rs | // Copyright 2014-2016 Johannes Köster.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Handling log-probabilities.
pub mod cdf;
use std::mem;
use std::f64;
use std::iter;
use std::ops::{Add, Sub, ... | }
impl From<Prob> for LogProb {
fn from(p: Prob) -> LogProb {
LogProb(p.ln())
}
}
impl From<PHREDProb> for LogProb {
fn from(p: PHREDProb) -> LogProb {
LogProb(*p * PHRED_TO_LOG_FACTOR)
}
}
impl From<Prob> for PHREDProb {
fn from(p: Prob) -> PHREDProb {
PHREDProb(-10.0 ... |
Prob(10.0f64.powf(-*p / 10.0))
}
| identifier_body |
mod.rs | // Copyright 2014-2016 Johannes Köster.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Handling log-probabilities.
pub mod cdf;
use std::mem;
use std::f64;
use std::iter;
use std::ops::{Add, Sub, ... | }
}
/// Numerically stable addition probabilities in log-space.
pub fn ln_add_exp(self, other: LogProb) -> LogProb {
let (mut p0, mut p1) = (self, other);
if p1 > p0 {
mem::swap(&mut p0, &mut p1);
}
if p0 == Self::ln_zero() {
Self::ln_zero()
... |
// TODO use sum() once it has been stabilized: .sum::<usize>()
pmax +
LogProb((probs
.iter()
.enumerate()
.filter_map(|(i, p)| if i == imax {
... | conditional_block |
mod.rs | // Copyright 2014-2016 Johannes Köster.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Handling log-probabilities.
pub mod cdf;
use std::mem;
use std::f64;
use std::iter;
use std::ops::{Add, Sub, ... | p: Prob) -> LogProb {
LogProb(p.ln())
}
}
impl From<PHREDProb> for LogProb {
fn from(p: PHREDProb) -> LogProb {
LogProb(*p * PHRED_TO_LOG_FACTOR)
}
}
impl From<Prob> for PHREDProb {
fn from(p: Prob) -> PHREDProb {
PHREDProb(-10.0 * p.log10())
}
}
impl From<LogProb> for ... | rom( | identifier_name |
cci_class_6.rs | // Copyright 2012 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-MIT or ... |
}
| {
cat {
meows: in_x,
how_hungry: in_y,
info: in_info
}
} | identifier_body |
cci_class_6.rs | // Copyright 2012 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-MIT or ... | info : Vec<U>,
meows : uint,
pub how_hungry : int,
}
impl<U> cat<U> {
pub fn speak<T>(&mut self, stuff: Vec<T> ) {
self.meows += stuff.len();
}
pub fn meow_count(&mut self) -> uint { self.meows }
}
pub fn cat<U>(in_x : uint, in_y : int, in_... |
pub struct cat<U> { | random_line_split |
cci_class_6.rs | // Copyright 2012 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-MIT or ... | <U> {
info : Vec<U>,
meows : uint,
pub how_hungry : int,
}
impl<U> cat<U> {
pub fn speak<T>(&mut self, stuff: Vec<T> ) {
self.meows += stuff.len();
}
pub fn meow_count(&mut self) -> uint { self.meows }
}
pub fn cat<U>(in_x : uint, in_y : in... | cat | identifier_name |
issue-1362.rs | // Copyright 2012 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-MIT or ... | let x: u32 = 20i32; //~ ERROR mismatched types
}
// NOTE: Do not add any extra lines as the line number the error is
// on is significant; an error later in the source file might not
// trigger the bug. | // except according to those terms.
// Regression test for issue #1362 - without that fix the span will be bogus
// no-reformat
fn main() { | random_line_split |
issue-1362.rs | // Copyright 2012 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-MIT or ... |
// NOTE: Do not add any extra lines as the line number the error is
// on is significant; an error later in the source file might not
// trigger the bug.
| {
let x: u32 = 20i32; //~ ERROR mismatched types
} | identifier_body |
issue-1362.rs | // Copyright 2012 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-MIT or ... | () {
let x: u32 = 20i32; //~ ERROR mismatched types
}
// NOTE: Do not add any extra lines as the line number the error is
// on is significant; an error later in the source file might not
// trigger the bug.
| main | identifier_name |
pdf.rs | // Copyright 2018-2019, 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>
use std::convert::TryFrom;
use std::ffi::{CStr, CString};
use std::fmt;
use std::io;
use std... | pub fn add_outline(
&self,
parent_id: i32,
name: &str,
link_attribs: &str,
flags: PdfOutline,
) -> Result<i32, Error> {
let name = CString::new(name).unwrap();
let link_attribs = CString::new(link_attribs).unwrap();
let res = unsafe {
... | #[cfg(any(all(feature = "pdf", feature = "v1_16"), feature = "dox"))] | random_line_split |
pdf.rs | // Copyright 2018-2019, 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>
use std::convert::TryFrom;
use std::ffi::{CStr, CString};
use std::fmt;
use std::io;
use std... | ;
impl io::Write for PanicWriter {
fn write(&mut self, _buf: &[u8]) -> io::Result<usize> {
panic!("panic in writer");
}
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
}
let surface = PdfSurface::for_stream(20., 2... | PanicWriter | identifier_name |
pdf.rs | // Copyright 2018-2019, 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>
use std::convert::TryFrom;
use std::ffi::{CStr, CString};
use std::fmt;
use std::io;
use std... |
#[test]
#[should_panic]
fn finish_stream_propagates_panic() {
let _ = with_panicky_stream().finish_output_stream();
}
}
| {
struct PanicWriter;
impl io::Write for PanicWriter {
fn write(&mut self, _buf: &[u8]) -> io::Result<usize> {
panic!("panic in writer");
}
fn flush(&mut self) -> io::Result<()> {
Ok(())
}
}
let surface = P... | identifier_body |
node_ops.rs | // Copyright 2021 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTI... | {
GetNodeWalletKey {
node_name: XorName,
msg_id: MessageId,
origin: SrcLocation,
},
PropagateTransfer {
proof: CreditAgreementProof,
msg_id: MessageId,
origin: SrcLocation,
},
SetNodeWallet {
wallet_id: PublicKey,
node_id: XorName,
... | NodeDuty | identifier_name |
node_ops.rs | // Copyright 2021 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTI... |
}
impl Debug for NodeDuty {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Self::Genesis {.. } => write!(f, "Genesis"),
Self::GetNodeWalletKey {.. } => write!(f, "GetNodeWalletKey"),
Self::PropagateTransfer {.. } => write!(f, "PropagateTransfer"... | {
if matches!(duty, NodeDuty::NoOp) {
vec![]
} else {
vec![duty]
}
} | identifier_body |
node_ops.rs | // Copyright 2021 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTI... | },
/// As members are lost for various reasons
/// there are certain things nodes need
/// to do, to update for that.
ProcessLostMember {
name: XorName,
age: u8,
},
/// Storage reaching max capacity.
ReachingMaxCapacity,
/// Increment count of full nodes in the networ... | /// The wallets of users on the network.
user_wallets: BTreeMap<PublicKey, ActorHistory>,
/// The metadata stored on Elders.
metadata: DataExchange, | random_line_split |
cabi.rs | // Copyright 2012 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-MIT or ... | match *a {
option::Some(attr) => {
unsafe {
let llarg = get_param(llfn, i);
llvm::LLVMAddAttribute(llarg, attr as c_uint);
}
}
_ => ()
}
}
retur... |
for self.attrs.iter().enumerate().advance |(i, a)| { | random_line_split |
cabi.rs | // Copyright 2012 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-MIT or ... |
pub fn build_shim_args(&self, bcx: block, arg_tys: &[Type], llargbundle: ValueRef)
-> ~[ValueRef] {
let mut atys: &[LLVMType] = self.arg_tys;
let mut attrs: &[option::Option<Attribute>] = self.attrs;
let mut llargvals = ~[];
let mut i = 0u;
let n... | {
let atys = self.arg_tys.iter().transform(|t| t.ty).collect::<~[Type]>();
let rty = self.ret_ty.ty;
let fnty = Type::func(atys, &rty);
let llfn = decl(fnty);
for self.attrs.iter().enumerate().advance |(i, a)| {
match *a {
option::Some(attr) => {
... | identifier_body |
cabi.rs | // Copyright 2012 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-MIT or ... | {
cast: bool,
ty: Type
}
pub struct FnType {
arg_tys: ~[LLVMType],
ret_ty: LLVMType,
attrs: ~[option::Option<Attribute>],
sret: bool
}
impl FnType {
pub fn decl_fn(&self, decl: &fn(fnty: Type) -> ValueRef) -> ValueRef {
let atys = self.arg_tys.iter().transform(|t| t.ty).collect::<... | LLVMType | identifier_name |
cabi.rs | // Copyright 2012 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-MIT or ... | ;
let mut i = 0u;
let n = atys.len();
while i < n {
let mut argval = get_param(llwrapfn, i + j);
if attrs[i].is_some() {
argval = Load(bcx, argval);
store_inbounds(bcx, argval, llargbundle, [0u, i]);
} else if atys[i].cast {
... | {
alloca(bcx, ret_ty, "")
} | conditional_block |
subst.rs | // Copyright 2012 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-MIT or ... | (&self, tcx: ty::ctxt, substs: &ty::substs) -> @T {
match self {
&@ref t => @t.subst(tcx, substs)
}
}
}
impl<T:Subst> Subst for Option<T> {
fn subst(&self, tcx: ty::ctxt, substs: &ty::substs) -> Option<T> {
self.map(|t| t.subst(tcx, substs))
}
}
impl Subst for ty::Trait... | subst | identifier_name |
subst.rs | // Copyright 2012 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-MIT or ... | }
}
///////////////////////////////////////////////////////////////////////////
// Other types
impl<T:Subst> Subst for ~[T] {
fn subst(&self, tcx: ty::ctxt, substs: &ty::substs) -> ~[T] {
self.map(|t| t.subst(tcx, substs))
}
}
impl<T:Subst> Subst for @T {
fn subst(&self, tcx: ty::ctxt, subst... | {
if !ty::type_needs_subst(*self) {
return *self;
}
match ty::get(*self).sty {
ty::ty_param(p) => {
substs.tps[p.idx]
}
ty::ty_self(_) => {
substs.self_ty.expect("ty_self not found in substs")
}
... | identifier_body |
subst.rs | // Copyright 2012 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-MIT or ... |
///////////////////////////////////////////////////////////////////////////
// Other types
impl<T:Subst> Subst for ~[T] {
fn subst(&self, tcx: ty::ctxt, substs: &ty::substs) -> ~[T] {
self.map(|t| t.subst(tcx, substs))
}
}
impl<T:Subst> Subst for @T {
fn subst(&self, tcx: ty::ctxt, substs: &ty::s... | }
}
}
} | random_line_split |
volume.rs | use crate::{fov::SphereVolumeFov, Location, World};
use calx::HexFov;
use std::iter::FromIterator;
impl World {
pub fn sphere_volume(&self, origin: Location, radius: u32) -> Volume {
Volume::sphere(self, origin, radius)
}
}
/// `Volume` is a specific area of the game world.
pub struct Volume(pub Vec<L... | (loc: Location) -> Volume { Volume(vec![loc]) }
/// Construct a sphere volume that follows portals and is stopped by walls.
///
/// The stopping walls are terrain for which `blocks_shot` is true.
pub fn sphere(w: &World, origin: Location, radius: u32) -> Volume {
// TODO: Add stop predicate to ... | point | identifier_name |
volume.rs | use crate::{fov::SphereVolumeFov, Location, World};
use calx::HexFov;
use std::iter::FromIterator;
impl World {
pub fn sphere_volume(&self, origin: Location, radius: u32) -> Volume {
Volume::sphere(self, origin, radius)
}
}
/// `Volume` is a specific area of the game world.
pub struct Volume(pub Vec<L... | ///
/// The stopping walls are terrain for which `blocks_shot` is true.
pub fn sphere(w: &World, origin: Location, radius: u32) -> Volume {
// TODO: Add stop predicate to API, allow passing through walls.
Volume(Vec::from_iter(
HexFov::new(SphereVolumeFov::new(w, radius, origin))... | pub fn point(loc: Location) -> Volume { Volume(vec![loc]) }
/// Construct a sphere volume that follows portals and is stopped by walls. | random_line_split |
drop_flag.rs | // 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 ... | (slot: &mut Self) -> (&mut T, DropFlag) {
(
&mut slot.value,
DropFlag {
counter: &slot.counter,
},
)
}
}
impl<T> Deref for DroppingFlag<T> {
type Target = T;
#[inline]
fn deref(&self) -> &T {
&self.value
}
}
impl<T> DerefMut for DroppingFlag<T> {
#[inline]
fn deref_... | as_parts_mut | identifier_name |
drop_flag.rs | // 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 ... |
}
}
/// An RAII trap that ensures a drop flag is correctly cleared.
///
/// This type is *similar* to a [`DroppingFlag`], except that it does not wrap
/// a value and rather than leaking memory aborts the program if its flag is
/// not cleared.
///
/// This type is useful for safely constructing [`MoveRef`]s.
pub s... | {
unsafe {
ManuallyDrop::drop(&mut self.value);
}
} | conditional_block |
drop_flag.rs | // 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 ... |
}
impl Drop for TrappedFlag {
fn drop(&mut self) {
self.assert_cleared();
}
}
/// A [`DropFlag`] source that doesn't do anything with it.
///
/// This is similar to `TrappedFlag`, but where it does not abort the program
/// if used incorrectly. This type is generally only useful when some separate
/// mechan... | {
Self::new()
} | identifier_body |
drop_flag.rs | // 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 ... | /// wrapped up in a [`MoveRef`]. When a `DroppingFlag` is destroyed, it will
/// run the destructor for the wrapped value if and only if the [`DropFlag`]
/// is dead.
///
/// This type can be viewed as using a [`DropFlag`] to "complete" a
/// [`ManuallyDrop<T>`] by explicitly tracking whether it has been dropped. The
/... | /// A wrapper for managing when a value gets dropped via a [`DropFlag`].
///
/// This type tracks the destruction state of some value relative to another
/// value via its [`DropFlag`]: for example, it might be the storage of a value | random_line_split |
stylesheet_loader.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::sync::Arc;
use style::gecko_bindings::bindings::Gecko_LoadStyleSheet;
use style::gecko_bindings::structs:... |
}
impl StyleStylesheetLoader for StylesheetLoader {
fn request_stylesheet(
&self,
media: MediaList,
make_import: &mut FnMut(MediaList) -> ImportRule,
make_arc: &mut FnMut(ImportRule) -> Arc<Locked<ImportRule>>,
) -> Arc<Locked<ImportRule>> {
// TODO(emilio): We probably... | {
StylesheetLoader(loader, parent)
} | identifier_body |
stylesheet_loader.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
| use style::shared_lock::Locked;
use style::stylesheets::{ImportRule, StylesheetLoader as StyleStylesheetLoader};
use style_traits::ToCss;
pub struct StylesheetLoader(*mut Loader, *mut ServoStyleSheet);
impl StylesheetLoader {
pub fn new(loader: *mut Loader, parent: *mut ServoStyleSheet) -> Self {
Styleshe... | use std::sync::Arc;
use style::gecko_bindings::bindings::Gecko_LoadStyleSheet;
use style::gecko_bindings::structs::{Loader, ServoStyleSheet};
use style::gecko_bindings::sugar::ownership::HasArcFFI;
use style::media_queries::MediaList; | random_line_split |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.