169 |
/// [`u8::MAX`]: https://doc.rust-lang.org/core/primitive.u8.html#associatedconstant.MAX
|
170 |
#[allow(clippy::cast_possible_truncation)]
|
171 |
pub fn generate_fixed_length_u8(&mut self, length: usize) -> u8 {
|
192 |
/// [`u16::MAX`]: https://doc.rust-lang.org/core/primitive.u16.html#associatedconstant.MAX
|
193 |
#[allow(clippy::cast_possible_truncation)]
|
194 |
pub fn generate_fixed_length_u16(&mut self, length: usize) -> u16 {
|
215 |
/// [`u32::MAX`]: https://doc.rust-lang.org/core/primitive.u32.html#associatedconstant.MAX
|
216 |
#[allow(clippy::cast_possible_truncation)]
|
217 |
pub fn generate_fixed_length_u32(&mut self, length: usize) -> u32 {
|
238 |
/// [`u64::MAX`]: https://doc.rust-lang.org/core/primitive.u64.html#associatedconstant.MAX
|
239 |
#[allow(clippy::cast_possible_truncation)]
|
240 |
pub fn generate_fixed_length_u64(&mut self, length: usize) -> u64 {
|
305 |
/// [`RangeInclusive`]: https://doc.rust-lang.org/core/ops/struct.RangeInclusive.html
|
306 |
#[allow(clippy::cast_possible_truncation)]
|
307 |
pub fn generate_u8_between_range(&mut self, range: core::ops::RangeInclusive<u8>) -> u8 {
|
200 |
}
|
201 |
#[allow(clippy::cast_possible_truncation)]
|
202 |
match get_uint(&mut self.stdin.lock(), default) {
|
288 |
#[allow(clippy::cast_possible_truncation)]
|
289 |
fn integrate_frame_gaps(&mut self) -> Result<(), SourceError> {
|
595 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
596 |
unsafe {
|
485 |
/// Reads a string
|
486 |
#[allow(clippy::cast_possible_truncation)]
|
487 |
fn partial_read_string(
|
33 |
ClockConfiguration::InternalToOutput { division_ratio } => {
|
34 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
35 |
let reg_ratio = f32::from(division_ratio).log2().round() as u8;
|
65 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
66 |
let values = [
|
118 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
119 |
let values = [
|
195 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
196 |
let value = (
|
229 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
230 |
let value = (
|
322 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
323 |
let values = [
|
63 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
64 |
let values = [
|
137 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
138 |
let values: [(u8, bool); 4] = [
|
256 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
257 |
let values = [
|
328 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
329 |
let values: [(u8, bool); 4] = [
|
36 |
impl Profiler {
|
37 |
#[allow(clippy::cast_possible_truncation)]
|
38 |
pub fn query_count(&self) -> u32 {
|
42 |
#[allow(clippy::cast_possible_truncation)]
|
43 |
pub fn query_index(&self) -> u32 {
|
77 |
}
|
78 |
#[allow(clippy::cast_possible_truncation)]
|
79 |
fn mean_avg_of_two(one: i8, two: i8) -> i8 {
|
86 |
};
|
87 |
#[allow(clippy::cast_possible_truncation)]
|
88 |
{
|
119 |
#[allow(clippy::cast_possible_truncation)]
|
120 |
{
|
215 |
};
|
216 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
217 |
let time_taken =
|
227 |
#[allow(
|
228 |
clippy::cast_possible_truncation,
|
229 |
clippy::cast_sign_loss,
|
236 |
#[allow(
|
237 |
clippy::cast_possible_truncation,
|
238 |
clippy::cast_sign_loss,
|
81 |
#[allow(
|
82 |
clippy::cast_possible_truncation,
|
83 |
clippy::cast_sign_loss,
|
92 |
#[allow(
|
93 |
clippy::cast_possible_truncation,
|
94 |
clippy::cast_sign_loss,
|
134 |
#[allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)]
|
135 |
impl<T: Tile, E: CoordinateEncoder> TileMap<T, E> {
|
306 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
307 |
fn to_tile(
|
343 |
} else {
|
344 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
345 |
Ok(Point3::new(
|
35 |
#[inline]
|
36 |
#[allow(clippy::cast_possible_truncation)]
|
37 |
pub fn morton_encode_lut(x: u32, y: u32, z: u32) -> u32 {
|
414 |
#[allow(
|
415 |
clippy::cast_possible_truncation,
|
416 |
clippy::cast_sign_loss,
|
25 |
// We only care about the highest bit of each byte for the mask.
|
26 |
#[allow(clippy::cast_possible_truncation, clippy::unnecessary_cast)]
|
27 |
pub const BITMASK_MASK: BitMaskWord = 0x8080_8080_8080_8080_u64 as GroupWord;
|
58 |
clippy::cast_sign_loss,
|
59 |
clippy::cast_possible_truncation
|
60 |
)]
|
75 |
clippy::cast_sign_loss,
|
76 |
clippy::cast_possible_truncation
|
77 |
)]
|
77 |
#[inline]
|
78 |
#[allow(clippy::cast_possible_truncation)]
|
79 |
fn h1(hash: u64) -> usize {
|
85 |
#[inline]
|
86 |
#[allow(clippy::cast_possible_truncation)]
|
87 |
fn h2(hash: u64) -> u8 {
|
265 |
#[allow(clippy::cast_possible_truncation, unused_mut)]
|
266 |
fn fill_blocks(
|
468 |
/// Hashes all the inputs into `blockhash[PREHASH_DIGEST_LEN]`.
|
469 |
#[allow(clippy::cast_possible_truncation)]
|
470 |
fn initial_hash(&self, pwd: &[u8], salt: &[u8], out: &[u8]) -> digest::Output<Blake2b512> {
|
44 |
/// Minimum number of memory blocks.
|
45 |
#[allow(clippy::cast_possible_truncation)]
|
46 |
pub const MIN_M_COST: u32 = 2 * SYNC_POINTS as u32; // 2 blocks per slice
|
149 |
/// Get the number of lanes.
|
150 |
#[allow(clippy::cast_possible_truncation)]
|
151 |
pub(crate) fn lanes(&self) -> usize {
|
550 |
pub fn from_int(u: u16) -> Self {
|
551 |
#[allow(clippy::cast_possible_truncation)]
|
552 |
let mut set = Self {
|
570 |
let mut u = 0_u32;
|
571 |
#[allow(clippy::cast_possible_truncation)]
|
572 |
for (i, &k) in self.set.iter().enumerate() {
|
580 |
let mut set = Self::empty();
|
581 |
#[allow(clippy::cast_possible_truncation)]
|
582 |
for (i, b) in set.set.iter_mut().enumerate() {
|
599 |
let mut u = 0_u32;
|
600 |
#[allow(clippy::cast_possible_truncation)]
|
601 |
for (i, &k) in self.set.iter().enumerate() {
|
609 |
let mut set = Self::empty();
|
610 |
#[allow(clippy::cast_possible_truncation)]
|
611 |
for (i, b) in set.set.iter_mut().enumerate() {
|
174 |
impl IntoLossy<u8> for usize {
|
175 |
#[allow(clippy::cast_possible_truncation)]
|
176 |
#[inline]
|
182 |
impl IntoLossy<u8> for u32 {
|
183 |
#[allow(clippy::cast_possible_truncation)]
|
184 |
#[inline]
|
918 |
// SAFETY: Caller guarantees we're within ascii range.
|
919 |
#[allow(clippy::cast_possible_truncation)] // We want to truncate it
|
920 |
unsafe {
|
934 |
// SAFETY: Caller guarantees we're within ascii range.
|
935 |
#[allow(clippy::cast_possible_truncation)] // We want to truncate it
|
936 |
unsafe {
|
79 |
#[allow(clippy::cast_possible_truncation, clippy::cast_ptr_alignment)]
|
80 |
pub(super) fn allocate(&mut self, string: &str) -> (&mut Entry, usize, usize) {
|
47 |
#[allow(clippy::cast_possible_truncation)]
|
48 |
pub(super) fn find(&self, name: &str, hash: u16) -> Option<&Entry> {
|
65 |
#[allow(clippy::cast_possible_truncation)]
|
66 |
pub(super) fn find_or_insert(
|
123 |
/// This is unsafe because pushing to the collection is not thread safe.
|
124 |
#[allow(clippy::cast_possible_truncation)]
|
125 |
pub(super) unsafe fn push(&self, value: *const T) -> (StringId, usize, usize) {
|
71 |
#[allow(clippy::cast_possible_truncation)]
|
72 |
fn write(&mut self, bytes: &[u8]) {
|
137 |
#[allow(clippy::cast_sign_loss)]
|
138 |
#[allow(clippy::cast_possible_truncation)]
|
139 |
fn from_day_number(mut day_number: i64) -> Result<(i32, u8, u8), Error> {
|
189 |
#[allow(clippy::cast_sign_loss)]
|
190 |
#[allow(clippy::cast_possible_truncation)]
|
191 |
pub fn new_abnormal(mut year: i32, month: i64, day: i64,
|
287 |
/// Panics on assertions that should only fail if there is a bug.
|
288 |
#[allow(clippy::cast_possible_truncation)]
|
289 |
#[allow(clippy::cast_precision_loss)]
|
339 |
/// The year part
|
340 |
#[allow(clippy::cast_possible_truncation)]
|
341 |
#[must_use]
|
347 |
/// The year part in BC years
|
348 |
#[allow(clippy::cast_possible_truncation)]
|
349 |
#[must_use]
|
355 |
/// The month part. Ranges from 1 .. 12
|
356 |
#[allow(clippy::cast_possible_truncation)]
|
357 |
#[must_use]
|
169 |
#[allow(clippy::cast_possible_truncation)]
|
170 |
#[allow(clippy::cast_precision_loss)]
|
36 |
#[must_use]
|
37 |
#[allow(clippy::cast_possible_truncation)]
|
38 |
pub fn from_julian_day_f64(jd: f64) -> Self {
|
49 |
#[must_use]
|
50 |
#[allow(clippy::cast_possible_truncation)]
|
51 |
pub fn from_julian_day_parts(day: i64, day_fraction: f64) -> Self {
|
342 |
//The shift is sound provided that `State` is `#[repr(u64)]`
|
343 |
#[allow(clippy::cast_possible_truncation)]
|
344 |
seq.serialize_element(&(bits as u32))?;
|
8 |
#[allow(clippy::cast_possible_truncation)]
|
9 |
fn parse_color(value: &str) -> Option<Color> {
|
109 |
// longest line prefix I could come up with
|
110 |
#[allow(clippy::cast_possible_truncation)] // we know that this is <65536 length
|
111 |
pub const PREFIX_LENGTH: u16 = " > 123ms 59s ago".len() as u16;
|
135 |
#[allow(clippy::cast_possible_truncation)] // we know that time.len() will be <6
|
136 |
fn time(&mut self, h: &History) {
|
135 |
#[allow(clippy::cast_possible_truncation)]
|
136 |
fn draw<T: Backend>(&mut self, f: &mut Frame<'_, T>, results: &[History]) {
|
226 |
#[allow(clippy::cast_possible_truncation)]
|
227 |
fn draw_compact<T: Backend>(&mut self, f: &mut Frame<'_, T>, results: &[History]) {
|
301 |
// modular. I'd like to add some more stats and stuff at some point
|
302 |
#[allow(clippy::cast_possible_truncation)]
|
303 |
pub async fn history(
|
109 |
#[allow(clippy::cast_possible_truncation)]
|
110 |
#[allow(clippy::cast_sign_loss)]
|
115 |
};
|
116 |
#[allow(clippy::cast_possible_truncation)]
|
117 |
#[allow(clippy::cast_sign_loss)]
|
92 |
#[must_use]
|
93 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
94 |
pub fn relative_degree(&self) -> i32 {
|
204 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
205 |
impl<'a> TryFrom<(usize, &'a graphql::CreateStepInput)> for NewStep<'a> {
|
126 |
#[must_use]
|
127 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
128 |
pub fn relative_degree(&self) -> i32 {
|
99 |
/// 2. The value is explicitly truncated and clamped to the integer value
|
100 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
101 |
fn f64_to_u64(value: f64) -> Result<u64> {
|
6 |
/// the value permits. Constructs an error message based on `msg` otherwise.
|
7 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::if_same_then_else)]
|
8 |
pub fn int_to_usize_with_msg<T: Into<i64>>(x: T, msg: &str) -> Result<usize> {
|
146 |
/// only way to specify a negative number.
|
147 |
#[allow(clippy::cast_possible_truncation)]
|
148 |
pub fn value_as_i32<R>(key: &str, lit: &Lit, range: R) -> Result<i32>
|
36 |
#[inline]
|
37 |
#[allow(clippy::cast_possible_truncation)]
|
38 |
#[allow(clippy::cast_sign_loss)]
|
276 |
#[allow(clippy::cast_possible_truncation)]
|
277 |
#[inline]
|
114 |
// the audio file's channel layout.
|
115 |
#[allow(clippy::cast_possible_truncation)]
|
116 |
let num_channels = match default_track.codec_params.channels {
|
121 |
#[allow(clippy::cast_possible_truncation)]
|
122 |
let num_samples_remaining: Option<usize> = default_track
|
26 |
#[allow(clippy::cast_precision_loss)]
|
27 |
#[allow(clippy::cast_possible_truncation)]
|
28 |
#[allow(clippy::cast_sign_loss)]
|
17 |
#[allow(clippy::cast_possible_truncation)]
|
18 |
#[allow(clippy::cast_sign_loss)]
|
68 |
#[allow(clippy::cast_possible_truncation)]
|
69 |
#[allow(clippy::cast_sign_loss)]
|
45 |
#[allow(clippy::cast_possible_truncation)]
|
46 |
#[allow(clippy::cast_precision_loss)]
|
21 |
#[inline]
|
22 |
#[allow(clippy::cast_possible_truncation)]
|
23 |
fn as_f32_sample(self) -> f32 {
|
36 |
#[inline]
|
37 |
#[allow(clippy::cast_possible_truncation)]
|
38 |
fn as_f32_sample(self) -> f32 {
|
23 |
#[allow(clippy::cast_possible_truncation)] // Truncation is used to remove the low part of the integer.
|
24 |
fn hi(self) -> Self::High {
|
28 |
#[allow(clippy::cast_possible_truncation)] // Truncation is used to remove the high part of the integer.
|
29 |
#[allow(clippy::cast_sign_loss)] // Sign loss is expected as `Self::Low` represents the lower part of the integer.
|
39 |
#[allow(clippy::cast_possible_truncation)] // Truncation is used to remove the low part of the integer.
|
40 |
fn hi(self) -> Self::High {
|
44 |
#[allow(clippy::cast_possible_truncation)] // Truncation is used to remove the high part of the integer.
|
45 |
fn lo(self) -> Self::Low {
|
60 |
let digit_with_rem = (u64::from(rem) << 32) | u64::from(*digit);
|
61 |
#[allow(clippy::cast_possible_truncation)]
|
62 |
// `digit_with_rem` is already truncated and `digit_with_rem % 3` is an integer modulo 3
|
67 |
}
|
68 |
#[allow(clippy::cast_possible_truncation)] // `rem` is an integer modulo 3.
|
69 |
{
|
40 |
/// Returns the weight - number of ending 0s - of the `Hash`.
|
41 |
#[allow(clippy::cast_possible_truncation)] // `HASH_LENGTH` is smaller than `u8::MAX`.
|
42 |
pub fn weight(&self) -> u8 {
|
24 |
// Doing a bitwise AND with `1` produces a value between `0` and `1` which fits in an `i8` without truncation.
|
25 |
#[allow(clippy::cast_possible_truncation)]
|
26 |
pub(super) fn bit(&self, i: usize) -> i8 {
|
318 |
for (i, sibling) in siblings.chunks(HASH_LENGTH).enumerate() {
|
319 |
#[allow(clippy::cast_possible_truncation)] // HASH_LENGTH < u8::max_value()
|
320 |
if depth == i as u8 {
|
27 |
for (i, node) in nodes.iter().enumerate() {
|
28 |
#[allow(clippy::cast_possible_truncation)]
|
29 |
let i = i as u32;
|
63 |
if let Some(pos) = labels.get(label) {
|
64 |
#[allow(clippy::cast_possible_truncation)]
|
65 |
let ins = cond | B | (*pos as u32);
|
36 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
37 |
fn sample_rate(&self) -> u32 {
|
33 |
#[allow(clippy::cast_possible_truncation)]
|
34 |
fn process(&mut self, dt: f64, _: &ClockInfoProvider) -> kira::dsp::Frame {
|
28 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
29 |
fn convert_to_audio_source(dsp_source: DspSource) -> Self::StaticAudioSource {
|
49 |
impl DspSource {
|
50 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
51 |
pub(crate) fn into_exact_size_iter(
|
124 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
125 |
fn advance(&self, dt: f32) {
|
31 |
clippy::cast_precision_loss,
|
32 |
clippy::cast_possible_truncation,
|
33 |
clippy::type_complexity,
|
153 |
#[must_use]
|
154 |
#[allow(clippy::cast_possible_truncation)]
|
155 |
pub fn duplicated_self(&self) -> Self {
|
6 |
#[allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)]
|
7 |
#[must_use]
|
18 |
#[allow(clippy::needless_pass_by_value, clippy::cast_possible_truncation)]
|
19 |
pub fn update_points(
|
9 |
#[cfg(feature = "write-bhttp")]
|
10 |
#[allow(clippy::cast_possible_truncation)]
|
11 |
fn write_uint(n: u8, v: impl Into<u64>, w: &mut impl io::Write) -> Res<()> {
|
137 |
#[allow(clippy::integer_arithmetic)]
|
138 |
#[allow(clippy::cast_possible_truncation)]
|
139 |
#[allow(clippy::indexing_slicing)]
|
162 |
// Lint: `count` is guaranteed to be <= BUF_SIZE
|
163 |
#[allow(clippy::cast_possible_truncation)]
|
164 |
writer.write_all(&ZEROES[..count as usize])?;
|
173 |
// Lint: `remaining` is guaranteed to be < BUF_SIZE
|
174 |
#[allow(clippy::cast_possible_truncation)]
|
175 |
writer.write_all(&ZEROES[..remaining as usize])?;
|
57 |
)]
|
58 |
#[allow(clippy::cast_possible_truncation)]
|
59 |
// It is going to be fine for a while and this method is deprecated
|
158 |
// Won't be an issue for the next 800 centuries
|
159 |
#[allow(clippy::cast_possible_truncation)]
|
160 |
Ok(Some(res.height as u32))
|
12 |
{
|
13 |
#[allow(clippy::cast_possible_truncation)]
|
14 |
const BITS: u32 = match T::BITS.checked_mul(N as u32) {
|
279 |
#[allow(clippy::wildcard_enum_match_arm, clippy::cast_possible_truncation)]
|
280 |
fn update(&mut self, value: Value) {
|
377 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation, unreadable_literal))]
|
378 |
#[cold]
|
9 |
// This will work for the next 20 years
|
10 |
#[allow(clippy::cast_possible_truncation)]
|
11 |
pub fn now() -> Self {
|
215 |
if let Some(handle) = self.attribute_handle {
|
216 |
#[allow(clippy::cast_possible_truncation)]
|
217 |
unsafe {
|
258 |
#[allow(clippy::cast_possible_truncation)]
|
259 |
unsafe {
|
105 |
if let Some(handle) = self.attribute_handle {
|
106 |
#[allow(clippy::cast_possible_truncation)]
|
107 |
unsafe {
|
137 |
#[allow(clippy::cast_possible_truncation)]
|
138 |
unsafe {
|
13 |
fn from(control: AttributeControl) -> Self {
|
14 |
#[allow(clippy::cast_possible_truncation)]
|
15 |
let result: u8 = match control {
|
43 |
impl From<AttributePermissions> for esp_gatt_perm_t {
|
44 |
#[allow(clippy::cast_possible_truncation)]
|
45 |
fn from(permissions: AttributePermissions) -> Self {
|
105 |
impl From<BleUuid> for esp_bt_uuid_t {
|
106 |
#[allow(clippy::cast_possible_truncation)]
|
107 |
fn from(val: BleUuid) -> Self {
|
103 |
impl From<CharacteristicProperties> for esp_gatt_char_prop_t {
|
104 |
#[allow(clippy::cast_possible_truncation)]
|
105 |
fn from(properties: CharacteristicProperties) -> Self {
|
224 |
}
|
225 |
#[allow(clippy::cast_possible_truncation)]
|
226 |
pub fn avg(&self) -> Duration {
|
501 |
#[allow(clippy::cast_sign_loss)]
|
502 |
#[allow(clippy::cast_possible_truncation)]
|
503 |
/// Get a benchmark result
|
508 |
#[allow(clippy::cast_sign_loss)]
|
509 |
#[allow(clippy::cast_possible_truncation)]
|
510 |
/// Get a benchmark result, specifying number of iterations made
|
598 |
#[allow(clippy::cast_possible_truncation)]
|
599 |
fn separator(title: &str) -> colored::ColoredString {
|
399 |
pub fn read_pressure_with_temperature(&mut self, temperature: f32) -> Result<Option<f32>, E> {
|
400 |
#[allow(clippy::cast_possible_truncation)] // Acceptable truncation
|
401 |
let t = (temperature * 100.0) as i32;
|
464 |
pub fn read_humidity_with_temperature(&mut self, temperature: f32) -> Result<Option<f32>, E> {
|
465 |
#[allow(clippy::cast_possible_truncation)] // Acceptable truncation
|
466 |
let t = (temperature * 100.0) as i32;
|
137 |
#[allow(clippy::cast_sign_loss)] // Using reference algorithm
|
138 |
#[allow(clippy::cast_possible_truncation)] // Acceptable truncation
|
139 |
let pressure = p as u32;
|
1298 |
/// Display the automatically generated help panel on the screen
|
1299 |
#[allow(clippy::cast_possible_truncation)]
|
1300 |
fn draw_help_screen(&mut self) {
|
18 |
impl From<Position> for AnsiPosition {
|
19 |
#[allow(clippy::cast_possible_truncation)]
|
20 |
fn from(p: Position) -> Self {
|
21 |
#[allow(clippy::cast_possible_wrap)]
|
22 |
#[allow(clippy::cast_possible_truncation)]
|
23 |
pub const N_TRAIL_VALUES: i32 = 256 - (N_EXCLUDED_CODES as i32);
|
39 |
#[allow(clippy::cast_sign_loss)]
|
40 |
#[allow(clippy::cast_possible_truncation)]
|
41 |
pub fn trail_to_byte(b: u8) -> u8 {
|
86 |
#[allow(clippy::cast_sign_loss)]
|
87 |
#[allow(clippy::cast_possible_truncation)]
|
88 |
pub fn encode_delta(delta: i32) -> EncodedChunk {
|
551 |
#[must_use]
|
552 |
#[allow(clippy::cast_possible_truncation)]
|
553 |
pub fn as_i64(&self) -> Option<i64> {
|
570 |
#[must_use]
|
571 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
572 |
pub fn as_i64_lossy(&self, saturating: bool) -> i64 {
|
588 |
#[must_use]
|
589 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
590 |
pub fn as_u64(&self) -> Option<u64> {
|
607 |
#[must_use]
|
608 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
609 |
pub fn as_u64_lossy(&self, saturating: bool) -> u64 {
|
739 |
let v = value as f64 / 100. * nb_variables;
|
740 |
#[allow(clippy::cast_possible_truncation)]
|
741 |
{
|
282 |
// libyara type cast this to a byte directly.
|
283 |
#[allow(clippy::cast_possible_truncation)]
|
284 |
#[allow(clippy::cast_sign_loss)]
|
22 |
#[allow(clippy::cast_possible_wrap)]
|
23 |
#[allow(clippy::cast_possible_truncation)]
|
24 |
#[allow(clippy::cast_sign_loss)]
|
1861 |
// Finally, add the filesize
|
1862 |
#[allow(clippy::cast_possible_truncation)]
|
1863 |
(csum as usize).wrapping_add(ctx.mem.len()).try_into().ok()
|
60 |
// Cannot truncate, so allow lint
|
61 |
#[allow(clippy::cast_possible_truncation)]
|
62 |
c.to_digit(16).map(|v| v as u8)
|
130 |
};
|
131 |
#[allow(clippy::cast_possible_truncation)]
|
132 |
res.push(((a as u8) << 4) + (b as u8));
|
30 |
#[allow(clippy::cast_possible_wrap)]
|
31 |
#[allow(clippy::cast_possible_truncation)]
|
32 |
fn index_to_point3d(&self, idx: usize) -> Point3 {
|
65 |
#[allow(clippy::cast_precision_loss)]
|
66 |
#[allow(clippy::cast_possible_truncation)]
|
67 |
#[inline]
|
85 |
/// Mixes a seed into a shortened bytestring key.
|
86 |
#[allow(clippy::cast_possible_truncation)] // Force wraparound at 256 for index.
|
87 |
fn mixkey(key: &[u8]) -> Vec<u8> {
|
194 |
/// used to build the output image by copy/pasting blocks accordingly.
|
195 |
#[allow(clippy::cast_possible_truncation)] // Indices fits in u32 here.
|
196 |
fn rearrange(&self, seed: &[u8], mode: Mode) -> impl Iterator<Item = (Rect, Rect)> + '_ {
|
35 |
clippy::cast_sign_loss,
|
36 |
clippy::cast_possible_truncation
|
37 |
)] // Safe given the ranges involved.
|
170 |
/// - If this function was already called on this request.
|
171 |
#[allow(clippy::cast_possible_truncation)]
|
172 |
pub fn format(&mut self, ext_opcode: Option<u8>, max_len: usize) -> Result<()> {
|
163 |
#[allow(
|
164 |
clippy::cast_possible_truncation,
|
165 |
clippy::let_and_return,
|
157 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
158 |
/// # Quantile.
|
1778 |
let frame_len = extra_len + frame.buf.len() - frame.payload_pos;
|
1779 |
#[allow(clippy::cast_possible_truncation)]
|
1780 |
buf.extend_from_slice(&(frame_len as u32).to_le_bytes()); // bytes 1-4
|
493 |
let n = name.as_bytes().to_vec();
|
494 |
#[allow(clippy::cast_possible_truncation)]
|
495 |
writer.write_all(&(name.len() as u16).to_le_bytes()).await?;
|
40 |
// we know that `Spur` is 32 bits
|
41 |
#[allow(clippy::cast_possible_truncation)]
|
42 |
pub fn as_u32(self) -> u32 {
|
154 |
// sections if there are already that amount.
|
155 |
#[allow(clippy::cast_possible_truncation)]
|
156 |
pub fn encode_to(self, buf: &mut Vec<u8>) {
|
102 |
pub fn lsl(ctx: &mut Context, op: &Op) -> PasmResult {
|
103 |
#[allow(clippy::cast_possible_truncation)]
|
104 |
fn checked_shl(dest: &mut usize, val: usize, mar: usize) {
|
132 |
} else {
|
133 |
#[allow(clippy::cast_possible_truncation)]
|
134 |
Some(Self(index as u32))
|
160 |
#[allow(
|
161 |
clippy::cast_possible_truncation,
|
162 |
clippy::cast_possible_wrap,
|
92 |
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
93 |
fn top_down_value(len: usize, i: usize) -> u32 {
|
268 |
//@TODO make everything used here return usize
|
269 |
#[allow(clippy::cast_possible_truncation)]
|
270 |
self.indices
|
100 |
#[allow(clippy::cast_sign_loss)]
|
101 |
#[allow(clippy::cast_possible_truncation)]
|
102 |
#[allow(clippy::cast_precision_loss)]
|
731 |
impl<'a> DirSizes<'a> {
|
732 |
#[allow(clippy::cast_possible_truncation, clippy::ptr_arg)]
|
733 |
#[allow(non_snake_case)]
|
677 |
#[allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)]
|
678 |
let perc: f32 =
|
65 |
/// Provides the `to_fixed` filter.
|
66 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
67 |
fn to_fixed(value: Value, options: HashMap<String, Value>) -> Result<Value> {
|
433 |
clippy::indexing_slicing,
|
434 |
clippy::cast_possible_truncation
|
435 |
)]
|
89 |
clippy::cast_precision_loss,
|
90 |
clippy::cast_possible_truncation,
|
91 |
clippy::cast_sign_loss
|
193 |
pub fn rounded(self) -> Vec2Int {
|
194 |
#[allow(clippy::cast_possible_truncation)]
|
195 |
Vec2Int {
|
412 |
// Attempt to truncate the value to see if it's the same value.
|
413 |
#[allow(clippy::cast_possible_truncation)]
|
414 |
let x32 = x as f32;
|
73 |
impl From<&Toc> for AccurateRip {
|
74 |
#[allow(clippy::cast_possible_truncation)]
|
75 |
fn from(src: &Toc) -> Self {
|
74 |
impl From<&Toc> for Cddb {
|
75 |
#[allow(clippy::cast_possible_truncation)]
|
76 |
fn from(src: &Toc) -> Self {
|
232 |
#[cfg(feature = "faster-hex")]
|
233 |
#[allow(unsafe_code, clippy::cast_possible_truncation)]
|
234 |
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
663 |
#[allow(clippy::cast_possible_truncation)]
|
664 |
#[must_use]
|
9 |
impl Toc {
|
10 |
#[allow(clippy::cast_possible_truncation, clippy::missing_panics_doc)]
|
11 |
#[cfg_attr(feature = "docsrs", doc(cfg(feature = "musicbrainz")))]
|
209 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
210 |
#[must_use]
|
247 |
impl Duration {
|
248 |
#[allow(clippy::many_single_char_names, clippy::cast_possible_truncation)]
|
249 |
#[must_use]
|
167 |
#[allow(clippy::cast_possible_truncation)]
|
168 |
fn next(&mut self) -> Option<Self::Item> {
|
498 |
#[must_use]
|
499 |
#[allow(clippy::cast_possible_truncation)]
|
500 |
pub const fn new(row_index: usize, col_index: usize) -> Option<Self> {
|
376 |
if dynamic.d_tag == tag {
|
377 |
#[allow(clippy::cast_possible_truncation)]
|
378 |
if let Some(name) =
|
401 |
#[allow(clippy::cast_possible_truncation)]
|
402 |
let size = count as usize;
|
147 |
}
|
148 |
#[allow(clippy::cast_possible_truncation)]
|
149 |
return size as usize;
|
471 |
#[allow(clippy::cast_possible_truncation)]
|
472 |
let size = natoms as usize;
|
503 |
}
|
504 |
#[allow(clippy::cast_possible_truncation)]
|
505 |
let size = natoms as usize;
|
537 |
}
|
538 |
#[allow(clippy::cast_possible_truncation)]
|
539 |
let size = natoms as usize;
|
575 |
}
|
576 |
#[allow(clippy::cast_possible_truncation)]
|
577 |
let size = natoms as usize;
|
129 |
}
|
130 |
#[allow(clippy::cast_possible_truncation)]
|
131 |
return size as usize;
|
238 |
}
|
239 |
#[allow(clippy::cast_possible_truncation)]
|
240 |
return indices.into_iter().map(|idx| idx as usize).collect();
|
315 |
#[allow(clippy::cast_possible_truncation)]
|
316 |
let size = count as usize;
|
380 |
}
|
381 |
#[allow(clippy::cast_possible_truncation)]
|
382 |
self.book.encode(&mut self.buffer, &(rank as u8))?;
|
235 |
impl From<u8x4> for (u8, u8, u8, u8) {
|
236 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
237 |
#[cfg_attr(not(debug_assertions), inline(always))]
|
251 |
impl From<&u8x4> for (u8, u8, u8, u8) {
|
252 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
253 |
#[cfg_attr(not(debug_assertions), inline(always))]
|
267 |
impl From<u8x4> for [u8; 4] {
|
268 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
269 |
#[cfg_attr(not(debug_assertions), inline(always))]
|
283 |
impl From<&u8x4> for [u8; 4] {
|
284 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
285 |
#[cfg_attr(not(debug_assertions), inline(always))]
|
235 |
impl From<u8x4> for (u8, u8, u8, u8) {
|
236 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
237 |
#[cfg_attr(not(debug_assertions), inline(always))]
|
251 |
impl From<&u8x4> for (u8, u8, u8, u8) {
|
252 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
253 |
#[cfg_attr(not(debug_assertions), inline(always))]
|
267 |
impl From<u8x4> for [u8; 4] {
|
268 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
269 |
#[cfg_attr(not(debug_assertions), inline(always))]
|
283 |
impl From<&u8x4> for [u8; 4] {
|
284 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
285 |
#[cfg_attr(not(debug_assertions), inline(always))]
|
109 |
#[allow(clippy::cast_possible_truncation)]
|
110 |
fn unique(index: usize) -> HandRankValue {
|
47 |
#[must_use]
|
48 |
#[allow(clippy::cast_possible_truncation)]
|
49 |
pub fn chen_formula(&self) -> i8 {
|
329 |
#[must_use]
|
330 |
#[allow(clippy::cast_possible_truncation)]
|
331 |
pub fn five_cards(five_cards: [CKCNumber; 5]) -> HandRankValue {
|
42 |
}
|
43 |
#[allow(clippy::cast_possible_truncation)]
|
223 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
224 |
fn clamp_to_u8(a: f32) -> u8 {
|
228 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
229 |
fn multiply_channel(a: u8, b: u8) -> u8 {
|
233 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
234 |
fn stretch_contrast(min: u8, max: u8, data: u8) -> u8 {
|
475 |
#[allow(clippy::cast_possible_truncation)]
|
476 |
if self.flags.is_clear(idx as u32) {
|
495 |
#[allow(clippy::cast_possible_truncation)]
|
496 |
if self.flags.is_clear(idx as u32) {
|
535 |
#[allow(clippy::cast_possible_truncation)]
|
536 |
if self.is_none(idx as u32) {
|
553 |
#[allow(clippy::cast_possible_truncation)]
|
554 |
if self.is_none(idx as u32) {
|
571 |
#[allow(clippy::cast_possible_truncation)]
|
572 |
if self.is_some(idx as u32) {
|
58 |
#[allow(clippy::cast_possible_truncation)]
|
59 |
unsafe impl Capacity for u8 {
|
73 |
#[allow(clippy::cast_possible_truncation)]
|
74 |
unsafe impl Capacity for u16 {
|
88 |
#[allow(clippy::cast_possible_truncation)]
|
89 |
unsafe impl Capacity for u32 {
|
104 |
#[allow(clippy::cast_possible_truncation)]
|
105 |
unsafe impl Capacity for u64 {
|
25 |
#[allow(clippy::cast_possible_truncation)]
|
26 |
fn creation_date(&self) -> DateTime<Utc> {
|
23 |
#[must_use]
|
24 |
#[allow(clippy::cast_possible_truncation)]
|
25 |
pub fn creation_date(&self) -> DateTime<Utc> {
|
109 |
let shared = unsafe { &*self.base };
|
110 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
111 |
let index = unsafe {
|
151 |
#[allow(clippy::cast_possible_truncation)]
|
152 |
RNG.try_with(|rng| {
|
41 |
/// - Panics if `alphabet` length is not 2, 4, 8, 16, 32 or 64.
|
42 |
#[allow(clippy::cast_possible_truncation)]
|
43 |
pub const fn new(alphabet: &str) -> Self {
|
85 |
clippy::cognitive_complexity,
|
86 |
clippy::cast_possible_truncation
|
87 |
)]
|
37 |
#[allow(clippy::cast_possible_truncation)]
|
38 |
pub const fn serialise_usize(bytes: &mut [u8], from: usize, value: usize) -> usize {
|
368 |
}
|
369 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
370 |
fn visit_f64<E>(self, value: f64) -> Result<Self::Value, E>
|
51 |
#[allow(clippy::cast_possible_truncation)]
|
52 |
let idx = Index {
|
434 |
/// only valid for a valid block
|
435 |
#[allow(clippy::cast_possible_truncation)]
|
436 |
pub fn track(self) -> u8 {
|
440 |
/// only valid for a valid block
|
441 |
#[allow(clippy::cast_possible_truncation)]
|
442 |
pub fn sector(self) -> u8 {
|
16 |
/// Computes the sector size as expected by the FDC from a human readable sector size
|
17 |
#[allow(clippy::cast_possible_truncation)]
|
18 |
#[allow(clippy::cast_sign_loss)]
|
368 |
#[allow(clippy::cast_possible_truncation)]
|
369 |
pub fn from_buffer(buffer: &[u8]) -> Self {
|
674 |
/// 06 - 07 actual data length in bytes 2
|
675 |
#[allow(clippy::cast_possible_truncation)]
|
676 |
pub fn to_buffer(&self, buffer: &mut Vec<u8>) {
|
771 |
/// Fill the information list with sectors corresponding to the provided arguments
|
772 |
#[allow(clippy::cast_possible_truncation)]
|
773 |
pub fn fill_with(
|
838 |
/// Number of bytes stored in the sector
|
839 |
#[allow(clippy::cast_possible_truncation)]
|
840 |
pub fn real_size(&self) -> u16 {
|
392 |
#[allow(clippy::cast_possible_wrap)]
|
393 |
#[allow(clippy::cast_possible_truncation)]
|
394 |
fn convert(matches: &ArgMatches) -> anyhow::Result<()> {
|
145 |
#[must_use]
|
146 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
147 |
pub fn linear_to_srgb(u: f32) -> u8 {
|
204 |
///
|
205 |
#[allow(clippy::cast_possible_truncation)]
|
206 |
pub fn write_rgba8<Writer, Iter>(
|
247 |
///
|
248 |
#[allow(clippy::cast_possible_truncation)]
|
249 |
pub fn write_rgb8<Writer, Iter>(
|
289 |
///
|
290 |
#[allow(clippy::cast_possible_truncation)]
|
291 |
pub fn write_grayalpha8<Writer, Iter>(
|
118 |
impl From<Duration> for NiceElapsed {
|
119 |
#[allow(clippy::cast_possible_truncation)] // It fits.
|
120 |
#[allow(clippy::cast_precision_loss)] // It fits.
|
238 |
#[allow(clippy::cast_possible_truncation)] // Size is previously asserted.
|
239 |
#[must_use]
|
318 |
impl NiceElapsed {
|
319 |
#[allow(clippy::cast_possible_truncation)] // We're checking first.
|
320 |
#[allow(clippy::cast_sign_loss)] // Values are unsigned.
|
220 |
#[allow(unsafe_code, clippy::cast_possible_truncation)] // One digit always fits u8.
|
221 |
/// # Write `u8` x 3
|
435 |
#[allow(unsafe_code)]
|
436 |
#[allow(clippy::cast_possible_truncation)] // They fit.
|
437 |
/// # Parse Top.
|
625 |
#[allow(clippy::cast_lossless)]
|
626 |
#[allow(clippy::cast_possible_truncation)]
|
627 |
#[allow(clippy::integer_division)]
|
671 |
#[allow(clippy::cast_lossless)]
|
672 |
#[allow(clippy::cast_possible_truncation)]
|
673 |
#[allow(clippy::integer_division)]
|
723 |
#[allow(clippy::cast_possible_truncation)]
|
724 |
/// # Round, Tie to Even.
|
66 |
impl From<u16> for NiceU16 {
|
67 |
#[allow(clippy::cast_possible_truncation)] // One digit always fits u8.
|
68 |
#[allow(unsafe_code)]
|
75 |
impl From<usize> for NiceU64 {
|
76 |
#[allow(clippy::cast_possible_truncation)] // It fits.
|
77 |
#[allow(clippy::only_used_in_recursion)] // Clippy is confused.
|
53 |
// TODO the lossy cast to i32 here...
|
54 |
#[allow(clippy::cast_possible_truncation)]
|
55 |
pub fn days_from_date(date: Date<Utc>) -> i32 {
|
123 |
if *n >= 0 && *n <= 37 {
|
124 |
#[allow(clippy::cast_possible_truncation)]
|
125 |
Ok(DamlTypePayload::Nat(*n as u8))
|
209 |
#[allow(clippy::cast_possible_truncation)]
|
210 |
fn parse_dalf_from_archive(zip_archive: &mut ZipArchive<File>, location: &str) -> DamlLfResult<DamlLfArchive> {
|
24 |
#[allow(
|
25 |
clippy::cast_possible_truncation,
|
26 |
clippy::unnecessary_cast,
|
120 |
#[inline]
|
121 |
#[allow(clippy::cast_possible_truncation)]
|
122 |
fn h1(hash: u64) -> usize {
|
128 |
#[inline]
|
129 |
#[allow(clippy::cast_possible_truncation)]
|
130 |
fn h2(hash: u64) -> u8 {
|
79 |
clippy::cast_sign_loss,
|
80 |
clippy::cast_possible_truncation
|
81 |
)]
|
103 |
clippy::cast_sign_loss,
|
104 |
clippy::cast_possible_truncation
|
105 |
)]
|
309 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
310 |
fn append_to(
|
362 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
363 |
fn gen_table(dialect: Dialect, rng: &mut dyn RngCore, target_size: f64) -> Table {
|
419 |
// Checked: we are extracting the lower and upper part of a 64-bit integer
|
420 |
#[allow(clippy::cast_possible_truncation)]
|
421 |
{
|
47 |
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
48 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
49 |
pub const fn i32_to_i16(x: i32) -> i16 {
|
424 |
// Checked: we are extracting the lower and upper part of a 32-bit integer
|
425 |
#[allow(clippy::cast_possible_truncation)]
|
426 |
{
|
107 |
// Checked: we want the lower 8 bits
|
108 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
109 |
if (fix & !((256 << frac_bits) - 1)) == 0 {
|
164 |
/// Truncate and interleave 2 int to 2 uchar
|
165 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
166 |
unsafe fn pack_i32x2(image: *mut u8, x: i32, y: i32) {
|
359 |
// Checked: this is proved to not go outside the 8-bit boundary
|
360 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
361 |
{
|
413 |
// Checked: this is proved to not go outside the 8-bit boundary
|
414 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
415 |
{
|
817 |
#[allow(
|
818 |
clippy::cast_possible_truncation,
|
819 |
clippy::cast_sign_loss,
|
528 |
/// Panics if `data.len()` > [`Self::available`].
|
529 |
#[allow(clippy::cast_possible_truncation)]
|
530 |
#[inline]
|
864 |
#[allow(
|
865 |
clippy::cast_possible_truncation,
|
866 |
clippy::cast_precision_loss,
|
434 |
#[cfg(feature = "flagset")]
|
435 |
#[allow(clippy::cast_possible_truncation, clippy::integer_arithmetic)]
|
436 |
impl<T: flagset::Flags> EncodeValue for flagset::FlagSet<T>
|
223 |
/// Note: this function **removes** the 1023 bias from the exponent and adds the implicit 1
|
224 |
#[allow(clippy::cast_possible_truncation)]
|
225 |
pub(crate) fn decode_f64(f: f64) -> (u64, u64, u64) {
|
261 |
}
|
262 |
#[allow(clippy::cast_possible_truncation)]
|
263 |
None => writer.write_byte(self.0 as u8),
|
113 |
#[allow(clippy::cast_possible_truncation)]
|
114 |
impl Iterator for IterSetupDiClassDevs {
|
66 |
// Try reading an empty header from the content.
|
67 |
#[allow(clippy::cast_possible_truncation)]
|
68 |
let mut header_bytes = vec![0u8; header.get_size() as usize];
|
84 |
clippy::cast_sign_loss,
|
85 |
clippy::cast_possible_truncation,
|
86 |
clippy::cast_precision_loss
|
92 |
#[allow(clippy::cast_possible_wrap)]
|
93 |
#[allow(clippy::cast_possible_truncation)]
|
94 |
pub fn as_bytes(&self, padding: bool) -> std::io::Result<Vec<u8>> {
|
88 |
fn div_rem_ceil(x: i32, y: i32) -> (i32, i32) {
|
89 |
#[allow(clippy::cast_possible_truncation)] // ⌈x/y⌉ is an integer <= |x|.
|
90 |
let q = (f64::from(x) / f64::from(y)).ceil() as i32;
|
180 |
#[allow(clippy::cast_sign_loss)] // ∀x,y>=0 ⌈x/y⌉>=0.
|
181 |
#[allow(clippy::cast_possible_truncation)] // ⌈x/y⌉ is an integer <=x.
|
182 |
let q = (f64::from(x) / f64::from(y)).ceil() as u32;
|
187 |
#[allow(clippy::cast_sign_loss)] // ∀n,m>=0 ⌈n/m⌉>=0
|
188 |
#[allow(clippy::cast_possible_truncation)] // ⌈x/y⌉ is an integer <=x.
|
189 |
let q = Wrapping((f64::from(x.0) / f64::from(y.0)).ceil() as u32);
|
741 |
clippy::cast_precision_loss,
|
742 |
clippy::cast_possible_truncation,
|
743 |
clippy::cast_sign_loss
|
761 |
type PublicKey = PublicKey;
|
762 |
#[allow(clippy::cast_possible_truncation)]
|
763 |
fn new<R: rand_core::CryptoRng + rand_core::RngCore>(rng: &mut R) -> Self {
|
781 |
}
|
782 |
#[allow(clippy::cast_possible_truncation)]
|
783 |
fn next_u32(&mut self) -> u32 {
|
312 |
#[allow(clippy::too_many_lines, clippy::cast_possible_truncation)]
|
313 |
fn def_vtable(
|
252 |
#[allow(clippy::cast_possible_truncation)]
|
253 |
fn def_init(
|
90 |
#[allow(clippy::cast_possible_truncation)]
|
91 |
match ev {
|
20 |
#[allow(clippy::cast_possible_truncation)]
|
21 |
pub(crate) fn delta(&mut self) -> f32 {
|
57 |
let i = rng.gen::<u64>() as f64 / 18_446_744_073_709_551_615.0_f64;
|
58 |
#[allow(clippy::cast_possible_truncation)]
|
59 |
Position::new(
|
210 |
/// convert this duration into nano seconds
|
211 |
#[allow(clippy::cast_possible_truncation)] // cast is okay, as u64::MAX as milliseconds is more than 500 million years
|
212 |
fn from(duration: &DurationHuman) -> Self {
|
153 |
impl From<&DurationInms> for u64 {
|
154 |
#[allow(clippy::cast_possible_truncation)] // cast is okay, as u64::MAX as milliseconds is more than 500 million years
|
155 |
fn from(duration: &DurationInms) -> Self {
|
104 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
105 |
fn notify(&mut self, battery: &SimpleBattery) {
|
3 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
4 |
#[cfg_attr(all(test, feature = "mocking"), mocktopus::macros::mockable)]
|
83 |
if s.is_empty() {
|
84 |
#[allow(clippy::cast_possible_truncation)]
|
85 |
Some(i as u8)
|
252 |
fn shake256(items: Vec<&[u8]>, ctx: &[u8], pre_hash: PreHash) -> Box<[u8]> {
|
253 |
#[allow(clippy::cast_possible_truncation)]
|
254 |
let mut shake = Shake256::default()
|
398 |
Edn::UInt(u) if isize::try_from(*u).is_ok() => Some(*u as isize),
|
399 |
#[allow(clippy::cast_possible_truncation)]
|
400 |
Edn::Double(d) => Some(d.clone().to_float().round() as isize),
|
401 |
#[allow(clippy::cast_possible_truncation)]
|
402 |
Edn::Rational(r) => Some(rational_to_double(r).unwrap_or(0f64).round() as isize),
|
417 |
#[allow(clippy::cast_sign_loss)]
|
418 |
#[allow(clippy::cast_possible_truncation)]
|
419 |
Some(d.clone().to_float().round() as usize)
|
423 |
#[allow(clippy::cast_sign_loss)]
|
424 |
#[allow(clippy::cast_possible_truncation)]
|
425 |
Some(rational_to_double(r)?.round() as usize)
|
135 |
#[allow(
|
136 |
clippy::cast_possible_truncation,
|
137 |
clippy::cast_precision_loss,
|
1734 |
let frame_len = extra_len + frame.buf.len() - frame.payload_pos;
|
1735 |
#[allow(clippy::cast_possible_truncation)]
|
1736 |
buf.extend_from_slice(&(frame_len as u32).to_le_bytes()); // bytes 1-4
|
493 |
let n = name.as_bytes().to_vec();
|
494 |
#[allow(clippy::cast_possible_truncation)]
|
495 |
writer.write_all(&(name.len() as u16).to_le_bytes()).await?;
|
153 |
for other_word in iter {
|
154 |
#[allow(clippy::cast_possible_truncation)]
|
155 |
let similarity = self.algo.similarity(other_word.chars(), self.word.chars()) as f32;
|
157 |
if similarity > self.threshold {
|
158 |
#[allow(clippy::cast_possible_truncation)]
|
159 |
return Some(ProximateWordItem::new((other_word, similarity as f32)));
|
184 |
// Similarity
|
185 |
#[allow(clippy::cast_possible_truncation)]
|
186 |
let similarity = self.algo.similarity(other_word.chars(), self.word.chars()) as f32;
|
51 |
assert!(size <= 0x7FFF_FFFF);
|
52 |
#[allow(clippy::cast_possible_truncation)] // asserted above
|
53 |
Self((size << 1) as _)
|
62 |
assert!(size <= 0x7FFF_FFFF);
|
63 |
#[allow(clippy::cast_possible_truncation)] // asserted above
|
64 |
Self((size << 1 | 1) as _)
|
383 |
impl SerializeIntoSlice for &str {
|
384 |
#[allow(clippy::cast_possible_truncation)]
|
385 |
fn write_into_slice(&self, buf: &mut [u8]) -> Result<usize, Error> {
|
492 |
/// - else: `n >= 16`
|
493 |
#[allow(clippy::cast_possible_truncation)]
|
494 |
pub fn serialize_array_start(n: usize, buf: &mut [u8]) -> Result<usize, Error> {
|
523 |
/// - else: `n >= 16`
|
524 |
#[allow(clippy::cast_possible_truncation)]
|
525 |
pub fn serialize_map_start(n: usize, buf: &mut [u8]) -> Result<usize, Error> {
|
38 |
#[allow(clippy::cast_sign_loss)]
|
39 |
#[allow(clippy::cast_possible_truncation)]
|
40 |
pub fn to_ext<'a>(&self, data: &'a mut [u8]) -> Result<Ext<'a>, SerError> {
|
88 |
#[allow(clippy::cast_possible_truncation)]
|
89 |
fn try_from(ext: Ext<'a>) -> Result<Self, Self::Error> {
|
206 |
#[allow(clippy::cast_possible_truncation)]
|
207 |
pub async fn set_position(
|
376 |
#[allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)]
|
377 |
pub async fn try_seek(self, conn: &SyncConnection, to: Offset) -> Result<Option<(Self, f64)>> {
|
253 |
#[allow(clippy::cast_possible_truncation)]
|
254 |
fn internal_decode(englishid: &str, header: DecodeMode) -> Result<Vec<u8>, Error> {
|
331 |
#[test]
|
332 |
#[allow(clippy::cast_possible_truncation)]
|
333 |
fn encode_with_custom_header_test() {
|
408 |
/// Calculates the modulus of self and `other`.
|
409 |
#[allow(clippy::cast_possible_truncation)]
|
410 |
#[must_use]
|
242 |
let range = v.trim().parse::<f64>()?;
|
243 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
244 |
{
|
125 |
#[allow(clippy::cast_precision_loss)]
|
126 |
#[allow(clippy::cast_possible_truncation)]
|
127 |
#[allow(clippy::cast_sign_loss)]
|
10 |
#[allow(clippy::cast_possible_truncation)]
|
11 |
#[allow(clippy::cast_sign_loss)]
|
176 |
};
|
177 |
#[allow(clippy::cast_possible_truncation)]
|
178 |
let instantiate_msg = InstantiateMsg {
|
52 |
#[inline]
|
53 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
54 |
fn from(tp: TimePoint) -> Self {
|
73 |
#[inline]
|
74 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
75 |
fn from(tps: TimePointSec) -> Self {
|
84 |
#[inline]
|
85 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
86 |
fn from(bt: BlockTimestamp) -> Self {
|
147 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
148 |
#[test]
|
55 |
#[must_use]
|
56 |
#[allow(clippy::cast_possible_truncation)]
|
57 |
pub const fn as_secs(&self) -> i32 {
|
62 |
#[must_use]
|
63 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
64 |
pub const fn as_time_point_sec(&self) -> TimePointSec {
|
58 |
#[must_use]
|
59 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
60 |
fn from(t: TimePoint) -> Self {
|
12 |
#[must_use]
|
13 |
#[allow(clippy::cast_possible_truncation)]
|
14 |
fn from(v: isize) -> Self {
|
73 |
#[inline]
|
74 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
75 |
fn read(bytes: &[u8], pos: &mut usize) -> Result<Self, ReadError> {
|
92 |
#[inline]
|
93 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
94 |
fn write(
|
6 |
let msg_ptr = msg.as_ptr();
|
7 |
#[allow(clippy::cast_possible_truncation)]
|
8 |
let msg_len = msg.len() as u32;
|
9 |
let data_ptr = data.as_ptr();
|
10 |
#[allow(clippy::cast_possible_truncation)]
|
11 |
let data_len = data.len() as u32;
|
28 |
let data_ptr = data.as_ptr();
|
29 |
#[allow(clippy::cast_possible_truncation)]
|
30 |
let data_len = data.len() as u32;
|
45 |
let data_ptr = data.as_ptr();
|
46 |
#[allow(clippy::cast_possible_truncation)]
|
47 |
let data_len = data.len() as u32;
|
64 |
let data_ptr = data.as_ptr();
|
65 |
#[allow(clippy::cast_possible_truncation)]
|
66 |
let data_len = data.len() as u32;
|
81 |
let data_ptr = data.as_ptr();
|
82 |
#[allow(clippy::cast_possible_truncation)]
|
83 |
let data_len = data.len() as u32;
|
32 |
#[inline]
|
33 |
#[allow(clippy::cast_possible_truncation)]
|
34 |
pub fn has_transaction_authority_bytes<T, K, L>(
|
77 |
let ptr = self.as_ptr();
|
78 |
#[allow(clippy::cast_possible_truncation)]
|
79 |
let len = self.len() as u32;
|
198 |
#[inline]
|
199 |
#[allow(clippy::cast_possible_truncation)]
|
200 |
fn print(&self) {
|
75 |
let buf_ptr = &mut buf as *mut _ as *mut u8;
|
76 |
#[allow(clippy::cast_possible_truncation)]
|
77 |
unsafe {
|
92 |
#[must_use]
|
93 |
#[allow(clippy::cast_possible_truncation)]
|
94 |
pub const fn symbol_to_precision(value: u64) -> u8 {
|
83 |
#[must_use]
|
84 |
#[allow(clippy::cast_possible_truncation)]
|
85 |
pub fn symbol_code_to_bytes(value: u64) -> [u8; SYMBOL_CODE_MAX_LEN] {
|
88 |
impl From<BleUuid> for esp_idf_sys::ble_uuid_any_t {
|
89 |
#[allow(clippy::cast_possible_truncation)]
|
90 |
fn from(val: BleUuid) -> Self {
|
680 |
}
|
681 |
#[allow(clippy::cast_possible_truncation)]
|
682 |
pub fn new(kind: ItemKind, group: &str, id: &str) -> EResult<Self> {
|
713 |
}
|
714 |
#[allow(clippy::cast_possible_truncation)]
|
715 |
fn _new0(kind: ItemKind, id: &str, need_check: bool) -> EResult<Self> {
|
493 |
#[allow(clippy::cast_possible_truncation)]
|
494 |
#[inline]
|
63 |
#[allow(clippy::cast_sign_loss)]
|
64 |
#[allow(clippy::cast_possible_truncation)]
|
65 |
#[inline]
|
180 |
#[allow(clippy::cast_possible_truncation)]
|
181 |
pub fn serialize_duration_as_micros<S>(t: &Duration, s: S) -> Result<S::Ok, S::Error>
|
188 |
#[allow(clippy::cast_possible_truncation)]
|
189 |
pub fn serialize_opt_duration_as_micros<S>(t: &Option<Duration>, s: S) -> Result<S::Ok, S::Error>
|
200 |
#[allow(clippy::cast_possible_truncation)]
|
201 |
pub fn serialize_duration_as_nanos<S>(t: &Duration, s: S) -> Result<S::Ok, S::Error>
|
208 |
#[allow(clippy::cast_possible_truncation)]
|
209 |
pub fn serialize_opt_duration_as_nanos<S>(t: &Option<Duration>, s: S) -> Result<S::Ok, S::Error>
|
260 |
#[allow(clippy::cast_possible_truncation)]
|
261 |
#[allow(clippy::cast_sign_loss)]
|
312 |
/// Rounds value to digits after comma, if the value is float
|
313 |
#[allow(clippy::cast_possible_truncation)]
|
314 |
#[allow(clippy::cast_sign_loss)]
|
384 |
#[allow(clippy::cast_possible_truncation)]
|
385 |
impl TryFrom<Value> for LogLevel {
|
452 |
impl<'a> Serialize for LogRecordS<'a> {
|
453 |
#[allow(clippy::cast_possible_truncation)]
|
454 |
#[allow(clippy::cast_sign_loss)]
|
520 |
#[allow(clippy::cast_possible_truncation)]
|
521 |
#[inline]
|
5 |
#[allow(clippy::cast_possible_truncation)]
|
6 |
pub fn serialize_duration_as_micros<S>(t: &Duration, s: S) -> Result<S::Ok, S::Error>
|
13 |
#[allow(clippy::cast_possible_truncation)]
|
14 |
pub fn serialize_opt_duration_as_micros<S>(t: &Option<Duration>, s: S) -> Result<S::Ok, S::Error>
|
75 |
#[allow(clippy::cast_sign_loss)]
|
76 |
#[allow(clippy::cast_possible_truncation)]
|
77 |
#[inline]
|
21 |
#[allow(clippy::cast_possible_truncation)]
|
22 |
#[allow(clippy::cast_sign_loss)]
|
690 |
let mut response = vec![header[0]];
|
691 |
#[allow(clippy::cast_possible_truncation)]
|
692 |
response.extend(&(resp.len() as u32).to_le_bytes());
|
33 |
#[inline]
|
34 |
#[allow(clippy::cast_possible_truncation)]
|
35 |
pub fn push_delay(&mut self, delay: Duration) {
|
37 |
#[inline]
|
38 |
#[allow(clippy::cast_possible_truncation)]
|
39 |
pub fn push_delay(&mut self, delay: Duration) {
|
140 |
#[allow(clippy::cast_sign_loss)]
|
141 |
#[allow(clippy::cast_possible_truncation)]
|
142 |
#[allow(clippy::cast_precision_loss)]
|
129 |
fn msb(self) -> Option<Self> {
|
130 |
#[allow(clippy::cast_possible_truncation)]
|
131 |
const MAX_BITS: u32 = 8 * std::mem::size_of::<TestBit>() as u32 - 1;
|
73 |
// FIXME: Replace computation with `BITS` once it lands in stable.
|
74 |
#[allow(clippy::cast_possible_truncation)]
|
75 |
const MAX_BITS: acl_flag_t = 8 * std::mem::size_of::<Flag>() as acl_flag_t - 1;
|
142 |
fn msb(self) -> Option<Self> {
|
143 |
#[allow(clippy::cast_possible_truncation)]
|
144 |
const MAX_BITS: acl_perm_t = 8 * std::mem::size_of::<Perm>() as acl_perm_t - 1;
|
145 |
#[allow(clippy::cast_possible_truncation)] // `TryFrom` cannot be used in const fns
|
146 |
const fn write_to_custom_section<const N: usize>(
|
208 |
#[doc(hidden)]
|
209 |
#[allow(clippy::cast_possible_truncation)] // `TryFrom` cannot be used in const fns
|
210 |
pub const fn custom_section<const N: usize>(&self) -> [u8; N] {
|
193 |
/// `global_max_cost` and `global_max_cost`/keys.
|
194 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
195 |
fn max_cost(sources_max: u32, recent_cost: u32, keys: u32) -> u32 {
|
266 |
let elapsed = now.saturating_duration_since(self.last);
|
267 |
#[allow(clippy::cast_possible_truncation)]
|
268 |
let elapsed_ticks = (elapsed.as_millis() / tick_duration.as_millis()) as u32;
|
354 |
self.sources_costs.update(self.tick_duration, now);
|
355 |
#[allow(clippy::cast_possible_truncation)]
|
356 |
let num_keys = self.keys.len() as u32;
|
392 |
new_source.costs.add(cost);
|
393 |
#[allow(clippy::cast_possible_truncation)]
|
394 |
let index = self.prng.rand_range(0..(MAX_KEYS as u32)) as usize;
|
438 |
) -> Result<FairRateLimiter<IpAddrKey, 1000>, String> {
|
439 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
440 |
let other_max = max((max_cost_per_sec * 0.20) as u32, 1);
|
125 |
#[allow(clippy::cast_sign_loss)]
|
126 |
#[allow(clippy::cast_possible_truncation)]
|
127 |
#[allow(clippy::cast_precision_loss)]
|
494 |
// just truncate an `u64`
|
495 |
#[allow(clippy::cast_possible_truncation)]
|
496 |
let res = self.next_u64() as u32;
|
160 |
#[allow(
|
161 |
clippy::cast_possible_truncation,
|
162 |
clippy::cast_sign_loss,
|
34 |
#[allow(clippy::cast_possible_truncation)]
|
35 |
const fn truncate(n: u128) -> u64 {
|
87 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
88 |
pub(crate) fn sample<I: Interrupt>(
|
108 |
#[allow(
|
109 |
clippy::cast_possible_truncation,
|
110 |
clippy::cast_sign_loss,
|
227 |
#[allow(clippy::cast_sign_loss)]
|
228 |
#[allow(clippy::cast_possible_truncation)]
|
229 |
pub fn build(self) -> Result<CorpusType, FeroxFuzzError> {
|
190 |
#[allow(clippy::cast_possible_truncation)]
|
191 |
let mutator_idx = state.rand_mut().below(upper_bound) as usize;
|
88 |
impl Mutator for ReplaceKeyword {
|
89 |
#[allow(clippy::cast_possible_truncation)]
|
90 |
#[allow(clippy::cast_sign_loss)]
|
155 |
#[instrument(skip_all, level = "trace")]
|
156 |
#[allow(clippy::cast_possible_truncation)]
|
157 |
#[allow(clippy::cast_sign_loss)]
|
264 |
#[instrument(skip(state), level = "trace")]
|
265 |
#[allow(clippy::cast_possible_truncation)]
|
266 |
#[allow(clippy::cast_sign_loss)]
|
65 |
#[allow(clippy::cast_possible_truncation)]
|
66 |
set_states_corpus_index(&self.state, index.name(), random_idx as usize)?;
|
168 |
#[instrument(skip_all, level = "trace")]
|
169 |
#[allow(clippy::cast_possible_truncation)]
|
170 |
#[allow(clippy::cast_sign_loss)]
|
58 |
.map(|n| {
|
59 |
#[allow(clippy::cast_possible_truncation)]
|
60 |
let id = n.value_of() as i64;
|
139 |
let result = ffi::exec(&command, Some(args), &options).await.map(|r| {
|
140 |
#[allow(clippy::cast_possible_truncation)]
|
141 |
let code = r.as_f64().expect("exec didn't return a number") as i32;
|
58 |
let random = random * ((1u64 << f64::MANTISSA_DIGITS) as f64);
|
59 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
60 |
let random = random as u64;
|
57 |
#[allow(clippy::cast_possible_truncation)]
|
58 |
if shifting {
|
88 |
#[allow(clippy::cast_possible_truncation)]
|
89 |
if shifting {
|
66 |
if (0xAC00..=0xD7A3).contains(&code_point) {
|
67 |
#[allow(clippy::cast_possible_truncation)]
|
68 |
let rep = decompose_jamo(code_point as u16);
|
263 |
/// column major matrix into the row major image.
|
264 |
#[allow(clippy::cast_possible_truncation)]
|
265 |
fn image_from_matrix<'a, T: Scalar, U: 'static + Primitive, F: Fn(&'a T) -> U>(
|
22 |
let file_size = file.metadata()?.len();
|
23 |
#[allow(clippy::cast_possible_truncation)]
|
24 |
let amount_to_read = if file_size < MAX_SIZE as u64 {
|
9 |
clippy::match_wildcard_for_single_variants,
|
10 |
clippy::cast_possible_truncation
|
11 |
)]
|
185 |
let mut buf = std::mem::MaybeUninit::<*mut Task>::uninit();
|
186 |
#[allow(clippy::cast_possible_truncation)]
|
187 |
unsafe {
|
227 |
#[allow(clippy::cast_possible_truncation)]
|
228 |
unsafe {
|
56 |
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
57 |
pub fn print_supported() {
|
270 |
{
|
271 |
#[allow(clippy::cast_possible_truncation)]
|
272 |
visitor.visit_f32(*v as f32)
|
61 |
let index = (row * self.pitch + col / 8) as usize;
|
62 |
#[allow(clippy::cast_possible_truncation)] // because we mod with 8 so result is 0 - 7
|
63 |
let bit_pos = (col % 8) as u8;
|
113 |
if c1.is_ascii_hexdigit() && c2.is_ascii_hexdigit() {
|
114 |
#[allow(clippy::cast_possible_truncation)] // two hex digit is a 8-bit number
|
115 |
Ok((c1.to_digit(16).unwrap() << 4 | c2.to_digit(16).unwrap()) as u8)
|
52 |
#[allow(clippy::cast_sign_loss)] // gray and multiplier both positive
|
53 |
#[allow(clippy::cast_possible_truncation)] // result small then ramp's length(usize)
|
54 |
let index = (f64::from(gray) * self.multiplier).floor() as usize;
|
44 |
#[allow(clippy::cast_sign_loss)] // because `255 - u8` must be non-negative
|
45 |
#[allow(clippy::cast_possible_truncation)] // result small then MOON_CHARS's length
|
46 |
let index = (f64::from(255 - gray) * self.multiplier).floor() as usize;
|
252 |
#[allow(clippy::cast_possible_truncation)] // never truncation because we `min` with 24
|
253 |
let list_width = self.state.name_width_max().min(32) as u16;
|
90 |
// Set v = denom with trailing zeros stripped off
|
91 |
#[allow(clippy::cast_possible_truncation)]
|
92 |
let mut v = ten_pow(denom_exp as u8) >> denom_exp;
|
75 |
let tmp: String;
|
76 |
#[allow(clippy::cast_possible_truncation)]
|
77 |
let prec = match form.precision() {
|
60 |
}
|
61 |
#[allow(clippy::cast_possible_truncation)]
|
62 |
if exponent < 0 {
|
71 |
#[inline]
|
72 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
73 |
fn create_file(
|
17 |
#[must_use]
|
18 |
#[allow(clippy::cast_possible_truncation)]
|
19 |
pub fn rank_count(&self) -> u8 {
|
23 |
#[must_use]
|
24 |
#[allow(clippy::cast_possible_truncation)]
|
25 |
pub fn suit_count(&self) -> u8 {
|
239 |
#[inline]
|
240 |
#[allow(clippy::cast_possible_truncation)] // We've previously asserted it fits.
|
241 |
/// # Total Buffer Length.
|
287 |
#[allow(clippy::cast_possible_truncation)] // We've previously asserted it fits.
|
288 |
#[allow(unsafe_code)]
|
295 |
impl Msg {
|
296 |
#[allow(clippy::cast_possible_truncation)] // MsgBuffer checks fit.
|
297 |
/// # New Message.
|
326 |
#[allow(clippy::cast_possible_truncation)] // MsgBuffer checks fit.
|
327 |
/// # Custom Prefix.
|
368 |
#[allow(clippy::cast_possible_truncation)] // MsgBuffer checks fit.
|
369 |
/// # Custom Prefix (Pre-formatted)
|
403 |
#[allow(clippy::cast_possible_truncation)] // MsgBuffer checks fit.
|
404 |
/// # New Message Without Any Prefix.
|
650 |
#[cfg_attr(feature = "docsrs", doc(cfg(feature = "timestamps")))]
|
651 |
#[allow(clippy::cast_possible_truncation)] // Date pieces have known values.
|
652 |
#[allow(clippy::cast_sign_loss)] // Date pieces have known values.
|
631 |
#[allow(clippy::cast_possible_truncation)] // These parts are constrained to u8::MAX.
|
632 |
/// # Tick Bar.
|
158 |
#[allow(clippy::cast_possible_truncation)]
|
159 |
let thousand = Self::THOUSAND as u16;
|
190 |
#[allow(clippy::cast_possible_truncation)]
|
191 |
let hundred = Self::HUNDRED as u8;
|
158 |
#[allow(clippy::cast_possible_truncation)]
|
159 |
let thousand = Self::THOUSAND as u16;
|
190 |
#[allow(clippy::cast_possible_truncation)]
|
191 |
let hundred = Self::HUNDRED as u8;
|
312 |
#[allow(clippy::cast_sign_loss)]
|
313 |
#[allow(clippy::cast_possible_truncation)]
|
314 |
fn color(button: >k::ColorButton) -> ReducedRGBA {
|
125 |
clippy::cast_precision_loss,
|
126 |
clippy::cast_possible_truncation,
|
127 |
clippy::cast_sign_loss,
|
626 |
/// Fails with [`std::io::Error`]
|
627 |
#[allow(clippy::cast_possible_truncation)]
|
628 |
pub fn from_path(path: &Path) -> Result<Self> {
|
67 |
#[allow(clippy::cast_possible_truncation)]
|
68 |
fn try_from(value: Config) -> std::result::Result<Self, Self::Error> {
|
626 |
/// Fails with [`std::io::Error`]
|
627 |
#[allow(clippy::cast_possible_truncation)]
|
628 |
pub fn from_path(path: &Path) -> Result<Self> {
|
67 |
#[allow(clippy::cast_possible_truncation)]
|
68 |
fn try_from(value: Config) -> std::result::Result<Self, Self::Error> {
|
240 |
#[allow(clippy::match_wildcard_for_single_variants)]
|
241 |
#[allow(clippy::cast_possible_truncation)]
|
242 |
async fn handle_bridge_event(&mut self, instruction: Instruction) -> Result<()> {
|
202 |
#[allow(clippy::cast_possible_truncation)]
|
203 |
let speed_int = usize::try_from(self.scroll_state.1 as i64)?.max(1);
|
44 |
None => 10,
|
45 |
#[allow(clippy::cast_possible_truncation)]
|
46 |
Some(v) => v as usize,
|
55 |
None => 0,
|
56 |
#[allow(clippy::cast_possible_truncation)]
|
57 |
Some(v) => v as usize,
|
66 |
None => 35,
|
67 |
#[allow(clippy::cast_possible_truncation)]
|
68 |
Some(v) => v as usize,
|
97 |
5 => {
|
98 |
#[allow(clippy::cast_possible_truncation)]
|
99 |
let color = iter.next().unwrap()[0].try_into().expect("usize to u8");
|
102 |
2 => {
|
103 |
#[allow(clippy::cast_possible_truncation)]
|
104 |
let r = iter.next().unwrap()[0].try_into().expect("usize to u8");
|
105 |
#[allow(clippy::cast_possible_truncation)]
|
106 |
let g = iter.next().unwrap()[0].try_into().expect("usize to u8");
|
107 |
#[allow(clippy::cast_possible_truncation)]
|
108 |
let b = iter.next().unwrap()[0].try_into().expect("usize to u8");
|
127 |
5 => {
|
128 |
#[allow(clippy::cast_possible_truncation)]
|
129 |
let color = iter.next().unwrap()[0].try_into().expect("usize to u8");
|
100 |
fn arb_matrix_sized(size: usize, stretch: usize) -> impl Strategy<Value = Vec<u32>> {
|
101 |
#[allow(clippy::cast_possible_truncation)]
|
102 |
Just((0..size * size * stretch).map(|i| i as u32).collect())
|
376 |
// must be 0-99, will fit in u16
|
377 |
#[allow(clippy::cast_possible_truncation)]
|
378 |
let segment = (process::id() % 100) as u16;
|
379 |
// since the size is `max - min` in a u16 range, will fit in u16
|
380 |
#[allow(clippy::cast_possible_truncation)]
|
381 |
let size = EPHEMERAL_PORT_RANGE.len() as u16;
|
240 |
let n_new_ids_needed = production.rhs.nodes.len() - production.int.nodes.len();
|
241 |
#[allow(clippy::cast_possible_truncation)]
|
242 |
let additional_ids = find_additional_ids(graph, n_new_ids_needed as u32);
|
77 |
}
|
78 |
#[allow(clippy::cast_possible_truncation)]
|
79 |
fn mean_avg_of_two(one: i8, two: i8) -> i8 {
|
142 |
// Cast safe thx to bounds.
|
143 |
#[allow(clippy::cast_possible_truncation)]
|
144 |
// SAFETY: `i` is bounded in [0; 6].
|
30 |
#[allow(clippy::cast_possible_truncation)] // on purpose
|
31 |
let (mut ri, mut rj, mut rk) =
|
107 |
/// cell in an aperture 7 grid.
|
108 |
#[allow(clippy::cast_possible_truncation)] // On purpose.
|
109 |
pub fn up_aperture7<const CCW: bool>(&self) -> Self {
|
236 |
// Cannot truncate thx to check above (unit vector).
|
237 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
238 |
let bits = (value.i << 2 | value.j << 1 | value.k) as u8;
|
149 |
// Check if we have the center of a hex.
|
150 |
#[allow(clippy::cast_possible_truncation)] // on purpose.
|
151 |
let m1 = x1 as i32;
|
152 |
#[allow(clippy::cast_possible_truncation)] // on purpose.
|
153 |
let m2 = x2 as i32;
|
22 |
/// The value must be a valid face.
|
23 |
#[allow(clippy::cast_possible_truncation)]
|
24 |
pub(crate) const fn new_unchecked(value: usize) -> Self {
|
136 |
(0..NUM_ICOSA_FACES).filter_map(move |offset| {
|
137 |
#[allow(clippy::cast_possible_truncation)]
|
138 |
// bounded by NUM_ICOSA_FACES.
|
103 |
// Truncate on purpose.
|
104 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
105 |
let estimate = estimate as usize;
|
361 |
// Truncate on purpose.
|
362 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
363 |
let estimate = dist_ceil as u64;
|
25 |
// We only care about the highest bit of each byte for the mask.
|
26 |
#[allow(clippy::cast_possible_truncation, clippy::unnecessary_cast)]
|
27 |
pub const BITMASK_MASK: BitMaskWord = 0x8080_8080_8080_8080_u64 as GroupWord;
|
130 |
#[inline]
|
131 |
#[allow(clippy::cast_possible_truncation)]
|
132 |
fn h1(hash: u64) -> usize {
|
145 |
#[inline]
|
146 |
#[allow(clippy::cast_possible_truncation)]
|
147 |
fn h2(hash: u64) -> u8 {
|
82 |
clippy::cast_sign_loss,
|
83 |
clippy::cast_possible_truncation
|
84 |
)]
|
106 |
clippy::cast_sign_loss,
|
107 |
clippy::cast_possible_truncation
|
108 |
)]
|
23 |
// We only care about the highest bit of each byte for the mask.
|
24 |
#[allow(clippy::cast_possible_truncation, clippy::unnecessary_cast)]
|
25 |
pub const BITMASK_MASK: BitMaskWord = 0x8080_8080_8080_8080_u64 as GroupWord;
|
119 |
#[inline]
|
120 |
#[allow(clippy::cast_possible_truncation)]
|
121 |
fn h1(hash: u64) -> usize {
|
127 |
#[inline]
|
128 |
#[allow(clippy::cast_possible_truncation)]
|
129 |
fn h2(hash: u64) -> u8 {
|
79 |
clippy::cast_sign_loss,
|
80 |
clippy::cast_possible_truncation
|
81 |
)]
|
103 |
clippy::cast_sign_loss,
|
104 |
clippy::cast_possible_truncation
|
105 |
)]
|
26 |
#[allow(clippy::cast_sign_loss)]
|
27 |
#[allow(clippy::cast_possible_truncation)]
|
28 |
match (id, value) {
|
170 |
#[allow(clippy::cast_possible_truncation)]
|
171 |
#[allow(clippy::cast_possible_wrap)]
|
260 |
);
|
261 |
#[allow(clippy::cast_possible_truncation)]
|
262 |
Ok(remaining_bufsize - size as u32 - padsize as u32)
|
31 |
pub fn emit(&self, w: &mut dyn std::io::Write) -> std::io::Result<()> {
|
32 |
#[allow(clippy::cast_possible_truncation)]
|
33 |
#[allow(clippy::cast_possible_wrap)]
|
60 |
#[allow(clippy::cast_possible_truncation)]
|
61 |
fn emit(&self, w: &mut dyn std::io::Write) -> std::io::Result<()> {
|
606 |
#[allow(clippy::cast_possible_truncation)]
|
607 |
#[allow(clippy::cast_possible_wrap)]
|
10 |
// asdasd
|
11 |
#[allow(clippy::cast_possible_truncation)]
|
12 |
pub(crate) fn emit(l: usize, w: &mut dyn std::io::Write) -> std::io::Result<()> {
|
125 |
#[allow(clippy::cast_possible_truncation)]
|
126 |
#[allow(clippy::cast_possible_wrap)]
|
27 |
#[allow(clippy::cast_possible_truncation)]
|
28 |
w.write_u32::<LittleEndian>(self.buf.len() as u32)?;
|
48 |
#[allow(clippy::cast_possible_truncation)]
|
49 |
#[allow(clippy::cast_possible_wrap)]
|
596 |
let multiplier = self.slow_motion_multiplier.read().unwrap();
|
597 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
598 |
let scaled_millis = millis * *multiplier as u64;
|
624 |
let multiplier = self.slow_motion_multiplier.read().unwrap();
|
625 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
626 |
let scaled_millis = millis * *multiplier as u64;
|
48 |
#[allow(clippy::cast_possible_truncation)]
|
49 |
#[allow(clippy::cast_sign_loss)]
|
17 |
unsafe {
|
18 |
#[allow(clippy::cast_possible_truncation)]
|
19 |
let socket_len = device.len() as nc::socklen_t;
|
54 |
unsafe {
|
55 |
#[allow(clippy::cast_possible_truncation)]
|
56 |
let len = std::mem::size_of_val(&queue_len) as u32;
|
76 |
fn encode(&self, buf: &mut Vec<u8>) -> Result<usize, EncodeError> {
|
77 |
#[allow(clippy::cast_possible_truncation)]
|
78 |
let len = self.0.len() as u16;
|
119 |
fn encode(&self, buf: &mut Vec<u8>) -> Result<usize, EncodeError> {
|
120 |
#[allow(clippy::cast_possible_truncation)]
|
121 |
let len = self.0.len() as u16;
|
335 |
fn encode(&self, buf: &mut Vec<u8>) -> Result<usize, EncodeError> {
|
336 |
#[allow(clippy::cast_possible_truncation)]
|
337 |
let len = self.0.len() as u16;
|
383 |
fn encode(&self, buf: &mut Vec<u8>) -> Result<usize, EncodeError> {
|
384 |
#[allow(clippy::cast_possible_truncation)]
|
385 |
let len = self.0.len() as u16;
|
162 |
}
|
163 |
#[allow(clippy::cast_possible_truncation)]
|
164 |
buf.push(m as u8);
|
233 |
#[inline(always)]
|
234 |
#[allow(clippy::cast_possible_truncation)]
|
235 |
fn receiver_pos(status: u64, capacity: usize) -> usize {
|
378 |
#[allow(clippy::cast_possible_truncation)]
|
379 |
// Safety: MAX_THREADS always fits in u32.
|
185 |
if ns_since_epoch < u128::from(NS_OVERFLOW) {
|
186 |
#[allow(clippy::cast_possible_truncation)] // Truncation is OK.
|
187 |
let offset = (ns_since_epoch & NS_SLOT_MASK) as TimeOffset;
|
220 |
let epoch_offset = now.duration_since(self.epoch).as_nanos();
|
221 |
#[allow(clippy::cast_possible_truncation)]
|
222 |
let epoch_offset = min(epoch_offset, u128::from(TimeOffset::MAX)) as TimeOffset;
|
249 |
/// This panics if the current slot is not empty.
|
250 |
#[allow(clippy::cast_possible_truncation)] // TODO: move to new `self.index` line.
|
251 |
#[allow(clippy::debug_assert_with_mut_call)]
|
337 |
/// [`TimeOffset`].
|
338 |
#[allow(clippy::cast_possible_truncation)] // TODO: move to last line.
|
339 |
fn as_offset(epoch: Instant, time: Instant) -> TimeOffset {
|
159 |
// Safety: `WakerId` is u8, so no truncating.
|
160 |
#[allow(clippy::cast_possible_truncation)]
|
161 |
WakerId((self.0 >> THREAD_SHIFT) as u8)
|
166 |
// Safety: checked pid in `WakerData::new`, so no truncation.
|
167 |
#[allow(clippy::cast_possible_truncation)]
|
168 |
ProcessId(self.0 & !THREAD_MASK)
|
178 |
.map(|worker_setup| {
|
179 |
#[allow(clippy::cast_possible_truncation)]
|
180 |
let trace_log = trace_log
|
194 |
if ns_since_epoch < u128::from(NS_OVERFLOW) {
|
195 |
#[allow(clippy::cast_possible_truncation)] // OK to truncate.
|
196 |
let deadline = (ns_since_epoch & NS_SLOT_MASK) as TimeOffset;
|
224 |
// `NS_PER_SLOT` anyway.
|
225 |
#[allow(clippy::cast_possible_truncation)]
|
226 |
let epoch_offset = min(epoch_offset, u128::from(TimeOffset::MAX)) as TimeOffset;
|
179 |
.map(|it| {
|
180 |
#[allow(clippy::cast_possible_truncation)]
|
181 |
Entity::from_bits(it.user_data as u64)
|
184 |
fn into_bevy(self) -> CollisionLayers {
|
185 |
#[allow(clippy::cast_possible_truncation)]
|
186 |
CollisionLayers::from_bits(self.memberships, self.filter)
|
93 |
#[must_use]
|
94 |
#[allow(clippy::cast_possible_truncation)]
|
95 |
fn ray_cast_internal(
|
206 |
#[must_use]
|
207 |
#[allow(clippy::cast_possible_truncation)]
|
208 |
fn shape_cast_internal(
|
444 |
#[allow(clippy::cast_possible_truncation)]
|
445 |
fn data(
|
114 |
#[allow(clippy::cast_possible_truncation)]
|
115 |
pub(crate) fn remove_sensor_flag(
|
104 |
#[must_use]
|
105 |
#[allow(clippy::cast_possible_truncation)]
|
106 |
/// Rounds floating point coordinates to [`Hex`]
|
30 |
#[allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)]
|
31 |
#[must_use]
|
720 |
#[cfg(feature = "streams")]
|
721 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
722 |
fn stream_endpoint<'a>(
|
423 |
#[cfg(feature = "streams")]
|
424 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
425 |
fn stream_channel_video_type(
|
24 |
// We only care about the highest bit of each byte for the mask.
|
25 |
#[allow(clippy::cast_possible_truncation, clippy::unnecessary_cast)]
|
26 |
pub const BITMASK_MASK: BitMaskWord = 0x8080_8080_8080_8080_u64 as GroupWord;
|
86 |
clippy::cast_sign_loss,
|
87 |
clippy::cast_possible_truncation
|
88 |
)]
|
110 |
clippy::cast_sign_loss,
|
111 |
clippy::cast_possible_truncation
|
112 |
)]
|
1412 |
#[inline]
|
1413 |
#[allow(clippy::cast_possible_truncation)]
|
1414 |
fn h1(hash: u64) -> usize {
|
1420 |
#[inline]
|
1421 |
#[allow(clippy::cast_possible_truncation)]
|
1422 |
fn h2(hash: u64) -> u8 {
|
346 |
#[allow(clippy::cast_sign_loss)]
|
347 |
#[allow(clippy::cast_possible_truncation)]
|
348 |
fn bound_to_dev_int(bound: f32) -> u16 {
|
393 |
needle_arr[..needle.len()].copy_from_slice(needle);
|
394 |
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
395 |
jetscii::Bytes::new(needle_arr, needle.len() as i32, |b| needle.contains(&b)).find(haystack)
|
39 |
// allow truncation as truncated remaining is always less than buf_size: usize
|
40 |
#[allow(clippy::cast_possible_truncation)]
|
41 |
pub fn into_stream_sized(
|
28 |
#[allow(clippy::cast_possible_truncation)] // Page number is small.
|
29 |
Ok(Page {
|
29 |
#[allow(clippy::cast_possible_truncation)] // Page number is small.
|
30 |
Ok(Page {
|
69 |
// Trim the chapters list to keep only the requested chapters.
|
70 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
71 |
let mut chapters = chapters
|
29 |
#[allow(clippy::cast_possible_truncation)] // Page number is small.
|
30 |
Ok(Page {
|
75 |
#[allow(clippy::cast_possible_truncation)] // No risk here.
|
76 |
Ok(Pagination::new(chapters[0], chapters.len() as u16))
|
100 |
// Trim the chapters list to keep only the requested chapters.
|
101 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
102 |
let mut chapters = chapters
|
29 |
#[allow(clippy::cast_possible_truncation)] // Page number is small.
|
30 |
Ok(Page {
|
69 |
// Trim the chapters list to keep only the requested chapters.
|
70 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
71 |
let mut chapters = chapters
|
76 |
#[allow(clippy::cast_possible_truncation)]
|
77 |
{
|
354 |
) -> Result<(), RenderError> {
|
355 |
#![allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
467 |
clippy::similar_names,
|
468 |
clippy::cast_possible_truncation,
|
469 |
clippy::cast_possible_wrap
|
572 |
fn gl_texture(&self, imgui_texture: imgui::TextureId) -> Option<glow::Texture> {
|
573 |
#[allow(clippy::cast_possible_truncation)]
|
574 |
Some(imgui_texture.id() as _)
|
61 |
{
|
62 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
63 |
let cluster_majority = (f32::from(full_size) * 0.5).ceil() as usize;
|
495 |
// We won't have negative elapsed_periods. Truncation this is the wanted result.
|
496 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
497 |
let periods_to_close = elapsed_periods as u32;
|
273 |
.div_ceil(u64::from(self.device.maximum_io));
|
274 |
#[allow(clippy::cast_possible_truncation)]
|
275 |
(rem as usize, rem.try_into().ok())
|
338 |
);
|
339 |
#[allow(clippy::cast_possible_truncation)]
|
340 |
(rem as usize, rem.try_into().ok())
|
47 |
if new != old {
|
48 |
#[allow(clippy::cast_possible_truncation)]
|
49 |
diffs.push((Position::from_idx(index as u16, self.size), new));
|
55 |
#[allow(clippy::cast_possible_truncation)]
|
56 |
let title_position = match self.alignment {
|
28 |
fn draw(&self, region: &mut Region) -> Result<()> {
|
29 |
#[allow(clippy::cast_possible_truncation)]
|
30 |
let position = match self.alignment {
|
24 |
// Doing a bitwise AND with `1` produces a value between `0` and `1` which fits in an `i8` without truncation.
|
25 |
#[allow(clippy::cast_possible_truncation)]
|
26 |
pub(super) fn bit(&self, i: usize) -> i8 {
|
23 |
#[allow(clippy::cast_possible_truncation)] // Truncation is used to remove the low part of the integer.
|
24 |
fn hi(self) -> Self::High {
|
28 |
#[allow(clippy::cast_possible_truncation)] // Truncation is used to remove the high part of the integer.
|
29 |
#[allow(clippy::cast_sign_loss)] // Sign loss is expected as `Self::Low` represents the lower part of the integer.
|
39 |
#[allow(clippy::cast_possible_truncation)] // Truncation is used to remove the low part of the integer.
|
40 |
fn hi(self) -> Self::High {
|
44 |
#[allow(clippy::cast_possible_truncation)] // Truncation is used to remove the high part of the integer.
|
45 |
fn lo(self) -> Self::Low {
|
61 |
let digit_with_rem = (u64::from(rem) << 32) | u64::from(*digit);
|
62 |
#[allow(clippy::cast_possible_truncation)]
|
63 |
// `digit_with_rem` is already truncated and `digit_with_rem % 3` is an integer modulo 3
|
68 |
}
|
69 |
#[allow(clippy::cast_possible_truncation)] // `rem` is an integer modulo 3.
|
70 |
{
|
103 |
/// Returns the weight - number of ending 0s - of the `Hash`.
|
104 |
#[allow(clippy::cast_possible_truncation)] // `HASH_LENGTH` is smaller than `u8::MAX`.
|
105 |
pub fn weight(&self) -> u8 {
|
282 |
// Won't truncate because the square root of u32::max_value is less than i32::max_value()
|
283 |
#[allow(clippy::cast_possible_truncation)]
|
284 |
let n = n as i32;
|
304 |
fn gen_checksum(check_digits: &[i8]) -> (u8, [char; 2]) {
|
305 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
306 |
let checksum = u8::try_from(
|
330 |
fn is_valid(check_digits: &[i8]) -> bool {
|
331 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
332 |
let check = u8::try_from(
|
455 |
clippy::cast_sign_loss,
|
456 |
clippy::cast_possible_truncation
|
457 |
)]
|
77 |
#[allow(clippy::cast_possible_truncation)]
|
78 |
fn inner_len_to_vec(&self) -> Vec<u8> {
|
323 |
#[test]
|
324 |
#[allow(clippy::cast_possible_truncation)]
|
325 |
fn tlv_to_from_vec_constructed() -> Result<()> {
|
129 |
/// serializes self into a byte vector.
|
130 |
#[allow(clippy::cast_possible_truncation)]
|
131 |
#[must_use]
|
321 |
#[test]
|
322 |
#[allow(clippy::cast_possible_truncation)]
|
323 |
fn serialize_parse() -> Result<()> {
|
93 |
pub fn center(&self) -> Point {
|
94 |
#[allow(clippy::cast_possible_truncation)]
|
95 |
Point::from(
|
103 |
/// Multiplies each component of this object by factor.
|
104 |
#[allow(clippy::cast_possible_truncation)]
|
105 |
fn mul_assign(&mut self, factor: f64) {
|
165 |
/// Divides each component of this object by `divisor`.
|
166 |
#[allow(clippy::cast_possible_truncation)]
|
167 |
fn div_assign(&mut self, divisor: f64) {
|
153 |
impl ops::MulAssign<f32> for Point {
|
154 |
#[allow(clippy::cast_possible_truncation)]
|
155 |
#[allow(clippy::cast_precision_loss)]
|
162 |
impl ops::MulAssign<f64> for Point {
|
163 |
#[allow(clippy::cast_possible_truncation)]
|
164 |
#[allow(clippy::cast_precision_loss)]
|
171 |
impl ops::DivAssign<f64> for Point {
|
172 |
#[allow(clippy::cast_possible_truncation)]
|
173 |
#[allow(clippy::cast_precision_loss)]
|
278 |
pub fn to_point(&self) -> Point {
|
279 |
#[allow(clippy::cast_possible_truncation)]
|
280 |
Point::from(self.x.round() as i32, self.y.round() as i32)
|
107 |
// Cast avoids overflow on addition.
|
108 |
#[allow(clippy::cast_possible_truncation)]
|
109 |
Point::from(
|
161 |
} else {
|
162 |
#[allow(clippy::cast_possible_truncation)]
|
163 |
let height =
|
241 |
fn mul(self, factor: f64) -> Self::Output {
|
242 |
#[allow(clippy::cast_possible_truncation)]
|
243 |
Self::Output {
|
216 |
let chunks = stream::try_unfold((file, offset), move |(mut file, pos)| async move {
|
217 |
#[allow(clippy::cast_possible_truncation)] // won't truncate the u64 remainder of an usize
|
218 |
let chunk_align = (pos % (CHUNK_SIZE as u64)) as usize;
|
271 |
iter::from_fn(move || {
|
272 |
#[allow(clippy::cast_possible_truncation)]
|
273 |
let chunk_no = (pos / (CHUNK_SIZE as u64)) as u32;
|
18 |
// ref. https://www.pololu.com/docs/0J73/12#serial-set-target
|
19 |
#[allow(clippy::cast_possible_truncation)]
|
20 |
self.write(&[
|
60 |
if number.fract() == 0.0 {
|
61 |
#[allow(clippy::cast_possible_truncation)]
|
62 |
Some(i128::from(number.trunc() as i64))
|
90 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
91 |
fn compute_row(&self, params: CpuParams, pixel_row: u32) -> Vec<u8> {
|
98 |
#[inline]
|
99 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
100 |
fn transform_pixel(&self, pixel: Luma<u8>) -> Self::Output {
|
134 |
clippy::cast_precision_loss,
|
135 |
clippy::cast_possible_truncation,
|
136 |
clippy::cast_sign_loss
|
259 |
#[allow(
|
260 |
clippy::cast_possible_truncation,
|
261 |
clippy::cast_precision_loss,
|
188 |
#[allow(clippy::cast_possible_truncation)]
|
189 |
fn render(&self, params: &Params) -> anyhow::Result<ImageBuffer> {
|
648 |
Some(current_nibble) => {
|
649 |
#[allow(clippy::cast_possible_truncation)]
|
650 |
let bits = *codepoint as u8 & 0xF;
|
66 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
67 |
Ok(Int32OrString::Int(v as i32))
|
84 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
85 |
Ok(Int32OrString::Int(v as i32))
|
135 |
) {
|
136 |
#[allow(clippy::cast_possible_truncation)]
|
137 |
let pos = Point2::new(x as f32, y as f32);
|
278 |
self.frame.local_scale_around(
|
279 |
#[allow(clippy::cast_possible_truncation)]
|
280 |
self.scale.compute(dy as f32),
|
984 |
// also, it's safe to cast, modulo logic...
|
985 |
#[allow(clippy::cast_possible_truncation)]
|
986 |
let position = (pseudo_random % self.map.len() as u64) as usize;
|
276 |
// We'll run out of memory before we hit the usize limit.
|
277 |
#[allow(clippy::cast_possible_truncation)]
|
278 |
let mut buffer = WriteableBytes::with_capacity(metadata.len() as usize);
|
637 |
// have memory...
|
638 |
#[allow(clippy::cast_possible_truncation)]
|
639 |
{
|
753 |
// Ehm no, it doesn't!
|
754 |
#[allow(clippy::cast_possible_truncation)]
|
755 |
let indent = indent.min(255) as u8;
|
22 |
impl Grad for HsvGrad {
|
23 |
#[allow(clippy::cast_possible_truncation)]
|
24 |
fn color_at(&self, pos: f64) -> (u8, u8, u8) {
|
50 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
51 |
let refills_since =
|
65 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
66 |
let refills_since =
|
57 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
58 |
let refills_since =
|
481 |
let mp = (5 * day_of_year + 2) / 153; // [0, 11]
|
482 |
#[allow(clippy::cast_possible_truncation)]
|
483 |
let day = (day_of_year - (153 * mp + 2) / 5 + 1) as u8; // [1, 31]
|
490 |
const fn hours(self) -> u8 {
|
491 |
#[allow(clippy::cast_possible_truncation)]
|
492 |
{
|
497 |
const fn minutes(self) -> u8 {
|
498 |
#[allow(clippy::cast_possible_truncation)]
|
499 |
{
|
504 |
const fn seconds(self) -> u8 {
|
505 |
#[allow(clippy::cast_possible_truncation)]
|
506 |
{
|
39 |
#[allow(clippy::cast_possible_truncation, clippy::as_conversions)]
|
40 |
pub fn cursor_position(position: &Position) {
|
153 |
let metadata = TuneableScheduledMutatorMetadata::get_mut(state).unwrap();
|
154 |
#[allow(clippy::cast_possible_truncation)]
|
155 |
if metadata.mutation_ids.is_empty() {
|
84 |
/// Gets the number of iterations as a random number
|
85 |
#[allow(clippy::cast_possible_truncation)]
|
86 |
fn iterations(&self, state: &mut Z::State, _corpus_idx: CorpusId) -> Result<u64, Error> {
|
362 |
#[allow(clippy::cast_possible_wrap)]
|
363 |
#[allow(clippy::cast_possible_truncation)]
|
364 |
match libpd_sys::libpd_list(
|
413 |
#[allow(clippy::cast_possible_wrap)]
|
414 |
#[allow(clippy::cast_possible_truncation)]
|
415 |
match libpd_sys::libpd_message(
|
1221 |
#[allow(clippy::cast_possible_truncation)]
|
1222 |
const BYTES_PER_WRITE: usize = 2 * IEC::Ki as usize * SECTOR_SIZE as usize;
|
191 |
// exactly one vs. 1024 KiB for 0.99 MiB.
|
192 |
#[allow(clippy::cast_possible_truncation)]
|
193 |
// This is allowed because the maximum value possible of
|
145 |
// the `8` (determined by the number of `ActionEvents` directions.
|
146 |
#[allow(clippy::cast_possible_truncation)]
|
147 |
let mut octant = (angle * 8.0).round() as i8;
|
27 |
let magic_string: &[u8] = b"i3-ipc";
|
28 |
#[allow(clippy::cast_possible_truncation)]
|
29 |
let length: &[u8] = &(payload.len() as u32).to_ne_bytes();
|
143 |
/// Calling external code may be unsafe.
|
144 |
#[allow(clippy::cast_possible_truncation)]
|
145 |
pub unsafe fn run(&mut self, sample_count: usize) {
|
12 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
13 |
fn logical_cpus() -> usize {
|
38 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
39 |
fn get_page_size() -> usize {
|
1218 |
if node.depth == 0 {
|
1219 |
#[allow(clippy::cast_possible_truncation)]
|
1220 |
let depth = slice.len() as u8;
|
50 |
#[allow(clippy::cast_sign_loss)]
|
51 |
#[allow(clippy::cast_possible_truncation)]
|
52 |
#[allow(clippy::cast_precision_loss)]
|
564 |
let multiplier = self.slow_motion_multiplier.read().unwrap();
|
565 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
566 |
let scaled_millis = millis * *multiplier as u64;
|
404 |
} else {
|
405 |
#[allow(clippy::cast_possible_truncation)]
|
406 |
Some(
|
421 |
} else {
|
422 |
#[allow(clippy::cast_possible_truncation)]
|
423 |
Some(
|
1505 |
impl From<HighResTimeStamp> for SystemTime {
|
1506 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
1507 |
#[inline]
|
1052 |
// that such casts are safe.
|
1053 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
1054 |
fn satisfies(this: Option<Self>, track: &sys::MediaStreamTrack) -> bool {
|
805 |
clippy::float_arithmetic,
|
806 |
clippy::cast_possible_truncation
|
807 |
)]
|
15 |
// This is intended and may be replaced by a safer way in the future.
|
16 |
#[allow(clippy::cast_possible_truncation, clippy::as_conversions)]
|
17 |
fn mutations_by_rate(genes: usize, rate: f64) -> usize {
|
79 |
// this is intended
|
80 |
#[allow(clippy::cast_possible_truncation, clippy::as_conversions)]
|
81 |
let passing_members = (population_size as f64 * self.proportion_to_keep) as usize; // "as usize" automatically rounds down for us
|
40 |
// _max_height is at least -1, so +1 is a least 0 - and it can never be higher than usize
|
41 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
42 |
pub fn update_height(&mut self) {
|
171 |
/// Reads data from the LOB at the specified offset into the provided buffer.
|
172 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
173 |
pub fn read_bytes(&self, offset: u64, length: u64) -> Result<Vec<i8>> {
|
60 |
// the prompt and show the cursor
|
61 |
#[allow(clippy::cast_possible_truncation)]
|
62 |
write!(
|
197 |
while n != 0 {
|
198 |
#[allow(clippy::cast_possible_truncation)]
|
199 |
{
|
81 |
/// The sort of this variable.
|
82 |
#[allow(clippy::cast_possible_truncation)]
|
83 |
#[inline]
|
169 |
fn pad_to(pos: usize, n: u8) -> (usize, usize) {
|
170 |
#[allow(clippy::cast_possible_truncation)] // actual truncation
|
171 |
let i = (n.wrapping_sub(pos as u8) & (n - 1)).into();
|
329 |
for t in &mut terms.0 {
|
330 |
#[allow(clippy::cast_possible_truncation)] // impossible because of previous check
|
331 |
t.p_args.set(t.p_args.get() + p_term_thm_buf as u32)
|
333 |
for t in &mut thms.0 {
|
334 |
#[allow(clippy::cast_possible_truncation)] // impossible because of previous check
|
335 |
t.p_args.set(t.p_args.get() + p_term_thm_buf as u32)
|
339 |
w.write_all(&MM0B_MAGIC)?; // magic
|
340 |
#[allow(clippy::cast_possible_truncation)] // impossible
|
341 |
w.write_all(&[MM0B_VERSION, num_sorts as u8, 0, 0])?; // two bytes reserved
|
343 |
w.write_u32::<LE>(num_thms.try_into().expect("too many thms"))?; // num_thms
|
344 |
#[allow(clippy::cast_possible_truncation)] // impossible
|
345 |
w.write_u32::<LE>(p_terms as u32)?;
|
328 |
evts = if (1..=3).contains(v) {
|
329 |
#[allow(clippy::cast_possible_truncation)]
|
330 |
Events::from_bits_truncate(*v as i32)
|
417 |
evts = if (1..=3).contains(v) {
|
418 |
#[allow(clippy::cast_possible_truncation)]
|
419 |
Events::from_bits_truncate(*v as i32)
|
78 |
);
|
79 |
#[allow(clippy::cast_possible_truncation)]
|
80 |
#[allow(clippy::cast_sign_loss)]
|
108 |
#[allow(clippy::many_single_char_names)]
|
109 |
#[allow(clippy::cast_possible_truncation)]
|
110 |
#[allow(clippy::cast_sign_loss)]
|
49 |
#[allow(clippy::cast_possible_truncation)]
|
50 |
#[allow(clippy::cast_sign_loss)]
|
1015 |
/// Enables heartbeat messages to be sent.
|
1016 |
#[allow(clippy::cast_possible_truncation)]
|
1017 |
pub fn idle_heartbeat(mut self, interval: Duration) -> Self {
|
928 |
/// Enables hearbeat messages to be sent.
|
929 |
#[allow(clippy::cast_possible_truncation)]
|
930 |
#[must_use]
|
38 |
#[allow(clippy::cast_possible_truncation)]
|
39 |
#[allow(clippy::cast_sign_loss)]
|
274 |
// casting the rounded square root from `f64` to `usize` is safe
|
275 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
276 |
let n_bins = (n_elems as f64).sqrt().round() as usize;
|
320 |
// casting the rounded cube root from `f64` to `usize` is safe
|
321 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
322 |
let n_bins = (2. * (n_elems as f64).powf(1. / 3.)).round() as usize;
|
366 |
// casting the rounded base-2 log from `f64` to `usize` is safe
|
367 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
368 |
let n_bins = (n_elems as f64).log2().round() as usize + 1;
|
67 |
#[allow(clippy::cast_possible_truncation)]
|
68 |
impl super::File for MemoryFile {
|
488 |
scratch[0] = 1;
|
489 |
#[allow(clippy::cast_possible_truncation)]
|
490 |
{
|
626 |
clippy::cast_precision_loss,
|
627 |
clippy::cast_possible_truncation,
|
628 |
clippy::cast_sign_loss
|
754 |
// We want to have varying sizes to try to test the scan algorithm thoroughly.
|
755 |
#[allow(clippy::cast_possible_truncation)]
|
756 |
if id % 2 == 0 {
|
1475 |
// Ensure alignment if we have a header
|
1476 |
#[allow(clippy::cast_possible_truncation)]
|
1477 |
let padding_needed = PAGE_SIZE - (writer.position % PAGE_SIZE as u64) as usize;
|
1536 |
/// Returns the position that this chunk can be read from in the file.
|
1537 |
#[allow(clippy::cast_possible_truncation)]
|
1538 |
fn write_chunk(&mut self, contents: &[u8]) -> Result<u64, Error> {
|
1571 |
#[allow(clippy::cast_possible_truncation)]
|
1572 |
#[cfg_attr(feature = "tracing", tracing::instrument(skip(file, vault, cache)))]
|
1651 |
clippy::cast_precision_loss,
|
1652 |
clippy::cast_possible_truncation,
|
1653 |
clippy::cast_sign_loss
|
2330 |
impl FileOp<()> for ExtendToPageBoundaryPlus {
|
2331 |
#[allow(clippy::cast_possible_truncation)]
|
2332 |
fn execute(self, file: &mut dyn File) {
|
94 |
// write_chunk errors if it can't fit within a u32
|
95 |
#[allow(clippy::cast_possible_truncation)]
|
96 |
let value_length = value.len() as u32;
|
511 |
let byte_from_hex = |hi, lo| {
|
512 |
#[allow(clippy::cast_possible_truncation)]
|
513 |
let nibble_from_hex = |ch| match ch {
|
971 |
// as `(n / 2) ^ n`. It's not exact, but good enough.
|
972 |
#[allow(clippy::cast_possible_truncation)]
|
973 |
let max = (0..32)
|
80 |
if v.trunc() == v {
|
81 |
#[allow(clippy::cast_possible_truncation)]
|
82 |
visitor.visit_i64(v as i64)
|
163 |
/// Converts a Rust `Duration` into an `nng_duration`.
|
164 |
#[allow(clippy::cast_possible_truncation)]
|
165 |
pub fn duration_to_nng(dur: Option<Duration>) -> nng_sys::nng_duration
|
106 |
#[deprecated(since = "0.10.0", note = "please use `new` instead.")]
|
107 |
#[allow(clippy::cast_possible_truncation)]
|
108 |
pub fn new_with(
|
148 |
#[allow(clippy::cast_possible_truncation)]
|
149 |
#[allow(clippy::cast_sign_loss)]
|
383 |
#[deprecated(since = "0.10.0", note = "please use `new` instead.")]
|
384 |
#[allow(clippy::cast_possible_truncation)]
|
385 |
pub fn new_with(
|
244 |
#[allow(clippy::cast_sign_loss)]
|
245 |
#[allow(clippy::cast_possible_truncation)]
|
246 |
pub fn raw_resolution(&self) -> Result<Resolution, NokhwaError> {
|
273 |
#[allow(clippy::cast_sign_loss)]
|
274 |
#[allow(clippy::cast_possible_truncation)]
|
275 |
pub fn raw_framerate(&self) -> Result<u32, NokhwaError> {
|
246 |
#[allow(clippy::cast_possible_truncation)]
|
247 |
fn compatible_list_by_resolution(
|
2006 |
/// If the camera fails to attach to the created `<video>`, this will error.
|
2007 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
2008 |
pub fn measure_resolution(&mut self) -> Result<(), NokhwaError> {
|
51 |
/// If the associated control is not found, this will return `None` (`ColorEnable`, `Roll`)
|
52 |
#[allow(clippy::cast_possible_truncation)]
|
53 |
pub fn known_camera_control_to_id(ctrl: KnownCameraControl) -> u32 {
|
99 |
#[allow(clippy::unnecessary_wraps)]
|
100 |
#[allow(clippy::cast_possible_truncation)]
|
101 |
pub fn query() -> Result<Vec<CameraInfo>, NokhwaError> {
|
823 |
/// If the associated control is not found, this will return `None` (`ColorEnable`, `Roll`)
|
824 |
#[allow(clippy::cast_possible_truncation)]
|
825 |
pub fn known_camera_control_to_id(_ctrl: KnownCameraControl) -> u32 {
|
215 |
#[allow(clippy::cast_possible_truncation)]
|
216 |
#[allow(clippy::cast_sign_loss)]
|
305 |
#[allow(clippy::cast_possible_truncation)]
|
306 |
#[inline]
|
1708 |
#[allow(clippy::many_single_char_names)]
|
1709 |
#[allow(clippy::cast_possible_truncation)]
|
1710 |
#[allow(clippy::cast_sign_loss)]
|
259 |
#[allow(clippy::cast_possible_truncation)]
|
260 |
pub fn to_rgb(&self) -> (u8, u8, u8) {
|
753 |
impl Paletted for NonogramsOrg {
|
754 |
#[allow(clippy::cast_possible_truncation)]
|
755 |
fn get_colors(&self) -> Vec<(String, char, String)> {
|
101 |
/// All generated bytes are valid ASCII characters in `[0-9A-Za-z]`.
|
102 |
#[allow(clippy::cast_possible_truncation)]
|
103 |
pub fn next_into(&mut self, buffer: &mut [u8; TOTAL_LEN]) {
|
162 |
pub fn shortest_requested() -> i32 {
|
163 |
#[allow(clippy::cast_possible_truncation)] // The value is clamped to i32::MAX.
|
164 |
{
|
160 |
// The CBOR fits in memory, so it must be <2³² elements.
|
161 |
#[allow(clippy::cast_possible_truncation)]
|
162 |
let len = len.ok_or_else(|| {
|
102 |
// Unicode code points are 0≤N≤0x10FFFF.
|
103 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
104 |
let character = d.f64()? as u32;
|
120 |
// Keycodes are small nonnegative numbers.
|
121 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
122 |
let keycode = d.f64()? as u32;
|
681 |
// If the CBOR fits in RAM, the array length must be ≤ maximum usize.
|
682 |
#[allow(clippy::cast_possible_truncation)]
|
683 |
let len = d.array()?.unwrap() as usize;
|
690 |
// OpenComputers is like that.
|
691 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
692 |
let port = d.f64()? as u16;
|
523 |
// The CBOR fits in memory, so it must be <2³² elements.
|
524 |
#[allow(clippy::cast_possible_truncation)]
|
525 |
let length = d
|
119 |
// numbers are always counts of Minecraft blocks so they are small nonnegative integers.
|
120 |
#[allow(clippy::cast_possible_truncation)]
|
121 |
#[allow(clippy::cast_sign_loss)]
|
125 |
// i32, and from_isize returns an unsigned value.
|
126 |
#[allow(clippy::cast_possible_truncation)]
|
127 |
Ok(Self::from_isize(value as isize)? as u32)
|
42 |
// We’re building for WASM which is always 32-bit.
|
43 |
#[allow(clippy::cast_possible_truncation)]
|
44 |
e.tag(EXTERNAL_REFERENCE)?
|
78 |
// We’re building for WASM which is always 32-bit.
|
79 |
#[allow(clippy::cast_possible_truncation)]
|
80 |
e.tag(EXTERNAL_REFERENCE)?
|
101 |
/// - Panics if the converted value is outside the `i32` bounds.
|
102 |
#[allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)]
|
103 |
// ^-- precision loss is OK in general, and we perform `i32` range check before
|
78 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
79 |
impl TryFrom<Color> for Vec<u8> {
|
299 |
pub fn set_app_context(&mut self, app_contexts: Vec<AppContext>) -> &mut ConnCreate {
|
300 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
301 |
let len = app_contexts.len() as u32;
|
59 |
fn from(s: &str) -> ODPIStr {
|
60 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
61 |
let s_len = s.len() as u32;
|
70 |
fn from(s: String) -> ODPIStr {
|
71 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
72 |
let s_len = s.len() as u32;
|
606 |
if let Some(index) = args.iter().position(|arg_name| *arg_name == identifier) {
|
607 |
#[allow(clippy::cast_possible_truncation)]
|
608 |
MacroBodyToken::ArgumentReference(index as ArgumentIndex, depth)
|
218 |
assert_le!(self.strings.len(),u32::MAX as usize);
|
219 |
#[allow(clippy::cast_possible_truncation)]
|
220 |
let name = Symbol::new(self.strings.len() as u32);
|
138 |
impl Altitude {
|
139 |
#[allow(clippy::cast_possible_truncation)]
|
140 |
fn m2ft(val: i32) -> Result<i32, &'static str> {
|
239 |
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)] // Impossible, since the RegEx limits length
|
240 |
fn parse_component(val: &str) -> Result<f64, ()> {
|
429 |
#[allow(clippy::cast_possible_truncation)]
|
430 |
let start = trace
|
434 |
.as_nanos() as i64;
|
435 |
#[allow(clippy::cast_possible_truncation)]
|
436 |
let duration = trace
|
26 |
pub(crate) fn fee(&self, vsize: usize) -> Amount {
|
27 |
#[allow(clippy::cast_possible_truncation)]
|
28 |
#[allow(clippy::cast_sign_loss)]
|
183 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
184 |
Ok(Sat(n as u64))
|
374 |
#[allow(clippy::cast_possible_truncation)]
|
375 |
#[allow(clippy::cast_sign_loss)]
|
41 |
fn varu_decoded_len(first_byte: u8) -> u8 {
|
42 |
#![allow(clippy::cast_possible_truncation)]
|
43 |
(first_byte.trailing_zeros() + 1) as u8
|
204 |
#[inline]
|
205 |
#[allow(clippy::cast_possible_truncation)] // can't happen because of cfg
|
206 |
fn read(mut reader: impl TailReadBytes) -> Result<usize> {
|
215 |
#[cfg(target_pointer_width = "32")]
|
216 |
#[allow(clippy::cast_possible_truncation)] // can't happen because of cfg
|
217 |
impl LengthEncoder for VarIntTailLenEncoder {
|
224 |
#[inline]
|
225 |
#[allow(clippy::cast_possible_truncation)] // can't happen because of cfg
|
226 |
fn read(mut reader: impl TailReadBytes) -> Result<usize> {
|
247 |
#[inline]
|
248 |
#[allow(clippy::cast_possible_truncation)] // can't happen because of cfg
|
249 |
fn read(mut reader: impl TailReadBytes) -> Result<usize> {
|
41 |
pub fn as_num_of_pages<T: PageSize>(self) -> NumOfPages<T> {
|
42 |
#[allow(clippy::cast_possible_truncation)]
|
43 |
NumOfPages::new((self.0 + T::SIZE as usize - 1) / T::SIZE as usize)
|
44 |
pub fn as_bytes(self) -> Bytes {
|
45 |
#[allow(clippy::cast_possible_truncation)]
|
46 |
Bytes::new(self.num_of_pages * T::SIZE as usize)
|
847 |
#[allow(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
|
848 |
fn expression_evaluator(
|
2278 |
clippy::float_cmp,
|
2279 |
clippy::cast_possible_truncation,
|
2280 |
clippy::cast_precision_loss
|
1458 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
1459 |
#[inline]
|
1528 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
1529 |
#[inline]
|
1537 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
1538 |
#[inline]
|
24 |
/// Constructs the decimal i / 10^n
|
25 |
#[allow(clippy::cast_possible_truncation)]
|
26 |
#[inline]
|
433 |
/// Formats the decimal following its canonical representation.
|
434 |
#[allow(clippy::cast_possible_truncation)]
|
435 |
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
413 |
/// [fn:days-from-duration](https://www.w3.org/TR/xpath-functions/#func-days-from-duration)
|
414 |
#[allow(clippy::cast_possible_truncation)]
|
415 |
#[inline]
|
420 |
/// [fn:hours-from-duration](https://www.w3.org/TR/xpath-functions/#func-hours-from-duration)
|
421 |
#[allow(clippy::cast_possible_truncation)]
|
422 |
#[inline]
|
427 |
/// [fn:minutes-from-duration](https://www.w3.org/TR/xpath-functions/#func-minutes-from-duration)
|
428 |
#[allow(clippy::cast_possible_truncation)]
|
429 |
#[inline]
|
452 |
// [61] secondFrag ::= ([0-5] digit) ('.' digit+)?
|
453 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
454 |
fn second_frag(input: &str) -> XsdResult<'_, Decimal> {
|
98 |
fn report(self) -> ExitCode {
|
99 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
100 |
match self.0 {
|
243 |
// pack the 4 LSBs of the size into the header
|
244 |
#[allow(clippy::cast_possible_truncation)] // value is masked
|
245 |
{
|
255 |
// read 7 LSBs from the `size` and push them off for the next iteration
|
256 |
#[allow(clippy::cast_possible_truncation)] // value is masked
|
257 |
let mut val = (size & 0b111_1111) as u8;
|
366 |
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
367 |
let xauthdata = XAuthData {
|
113 |
#[inline]
|
114 |
#[allow(clippy::cast_possible_truncation)]
|
115 |
pub fn put_binary(&mut self, index: usize, response_type: u8, response: &[u8]) {
|
91 |
&mut file_out,
|
92 |
#[allow(clippy::cast_possible_truncation)]
|
93 |
{
|
2520 |
// this is not going to overflow
|
2521 |
#[allow(clippy::cast_possible_truncation)]
|
2522 |
let len = cursor.position() as usize;
|
92 |
#[allow(clippy::cast_possible_truncation)]
|
93 |
const fn from_usize<const N : usize>(x : usize) -> ArbitraryBytes<N> {
|
234 |
let second_last_bit = value.0.get(N-2).copied().unwrap_or_default();
|
235 |
#[allow(clippy::cast_possible_truncation)] //false positive. This function is only compiled on 64bit systems.
|
236 |
last_bit.map(|last_bit| u64_from_u32s(second_last_bit, last_bit) as usize)
|
312 |
impl<const N : usize> MulAssign<&usize> for ArbitraryBytes<N>{
|
313 |
#[allow(clippy::cast_possible_truncation)] //truncation is intentional here.
|
314 |
fn mul_assign(&mut self, rhs: &usize) {
|
453 |
debug_assert!(guesstimate & u64::from(u32::MAX) == guesstimate, "The while above should have made guesstimate a one-digit number. Debug!");
|
454 |
#[allow(clippy::cast_possible_truncation)]
|
455 |
let mut guesstimate = guesstimate as u32;
|
327 |
// Returns bytes, because there's no way that this transform doesn't break the string.
|
328 |
#[allow(clippy::cast_possible_truncation)] //clippy, stop complaining. Truncating is the very purpose of this function...
|
329 |
fn yeet_upper_bytes(input : &str) -> impl Iterator<Item=u8> + Clone + '_ {
|
16 |
#[allow(
|
17 |
clippy::cast_possible_truncation,
|
18 |
clippy::cast_precision_loss,
|
149 |
clippy::cast_precision_loss,
|
150 |
clippy::cast_possible_truncation
|
151 |
)]
|
574 |
clippy::cast_precision_loss,
|
575 |
clippy::cast_possible_truncation,
|
576 |
clippy::cast_sign_loss,
|
600 |
clippy::cast_precision_loss,
|
601 |
clippy::cast_possible_truncation,
|
602 |
clippy::float_cmp
|
362 |
/// Print a floating point with at least 1 decimal place and at max 5 decimals
|
363 |
#[allow(clippy::cast_possible_truncation)]
|
364 |
fn print_float(num: f64) -> String {
|
495 |
]);
|
496 |
#[allow(clippy::cast_possible_truncation)]
|
497 |
if atom.anisotropic_temperature_factors().is_some() {
|
327 |
/// Get the charge in the PDB format `[0-9][-+]`. If the charge is 0 or outside bounds (below -9 or above 9) it returns an empty string.
|
328 |
#[allow(clippy::cast_possible_truncation)]
|
329 |
pub fn pdb_charge(&self) -> String {
|
58 |
pub fn as_sys(&self) -> sysVibePattern<'a> {
|
59 |
#[allow(clippy::cast_possible_truncation)] // Checked in constructor.
|
60 |
sysVibePattern {
|
98 |
/// Starts profiling an event with the given `category` and `label`.
|
99 |
#[allow(clippy::cast_possible_truncation)]
|
100 |
pub fn trace(&self, category: &str, label: &str) -> Guard<'_> {
|
65 |
#[allow(clippy::cast_possible_truncation)]
|
66 |
fn compute_node_id() -> u32 {
|
3 |
#[allow(clippy::cast_possible_truncation)]
|
4 |
pub fn now_timestamp() -> u64 {
|
65 |
#[allow(clippy::cast_possible_truncation)]
|
66 |
fn compute_node_id() -> u32 {
|
3 |
#[allow(clippy::cast_possible_truncation)]
|
4 |
pub fn now_timestamp() -> u64 {
|
3 |
#[allow(clippy::cast_possible_truncation)]
|
4 |
#[allow(clippy::cast_sign_loss)]
|
161 |
//events.push(Events::MouseMove(x, y));
|
162 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
163 |
{
|
368 |
clippy::cast_sign_loss,
|
369 |
clippy::cast_possible_truncation
|
370 |
)]
|
437 |
#[allow(clippy::cast_possible_truncation)] // this value is limited above
|
438 |
let mut results = Vec::with_capacity(result_limit);
|
234 |
#[cfg(test)]
|
235 |
#[allow(clippy::cast_possible_truncation)]
|
236 |
mod test {
|
31 |
#[allow(clippy::cast_possible_truncation)]
|
32 |
fn write_lat_lon(output: &mut BitVec<u8, Msb0>, field: f64) -> Result<(), DekuError> {
|
208 |
#[allow(clippy::cast_possible_truncation)]
|
209 |
let length = tile_data.len() as u32;
|
34 |
#[allow(clippy::cast_possible_truncation)]
|
35 |
let tile_id =
|
78 |
#[allow(clippy::cast_possible_truncation)]
|
79 |
let (x, y) =
|
93 |
leaf_dir.to_writer(&mut leaf_dir_writer, compression)?;
|
94 |
#[allow(clippy::cast_possible_truncation)]
|
95 |
let length = (leaf_dir_writer.stream_position()? - offset) as u32;
|
114 |
#[cfg_attr(feature = "tracing", instrument(skip(visitor)))]
|
115 |
#[allow(clippy::cast_possible_truncation)]
|
116 |
fn visit_symbol<V>(&mut self, atom: &Atom<'_>, visitor: V) -> Result<V::Value>
|
154 |
#[cfg_attr(feature = "tracing", instrument(skip(visitor)))]
|
155 |
#[allow(clippy::cast_possible_truncation)]
|
156 |
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
|
544 |
#[cfg_attr(feature = "tracing", instrument(skip(visitor)))]
|
545 |
#[allow(clippy::cast_possible_truncation)]
|
546 |
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value>
|
635 |
#[cfg_attr(feature = "tracing", instrument(skip(visitor)))]
|
636 |
#[allow(clippy::cast_possible_truncation)]
|
637 |
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value>
|
672 |
#[cfg_attr(feature = "tracing", instrument(skip(visitor)))]
|
673 |
#[allow(clippy::cast_possible_truncation)]
|
674 |
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value>
|
11 |
/// Writes an atom header into `writer`.
|
12 |
#[allow(clippy::cast_possible_truncation)]
|
13 |
pub fn write_atom_header<W: WriteBytesExt>(
|
169 |
/// Reads a Pot header. See `write_header` for more information. Returns the version number contained within.
|
170 |
#[allow(clippy::similar_names, clippy::cast_possible_truncation)]
|
171 |
pub fn read_header<R: ReadBytesExt>(reader: &mut R) -> Result<u8, Error> {
|
384 |
/// Writes an [`Kind::Float`] atom with the given value.
|
385 |
#[allow(clippy::cast_possible_truncation, clippy::float_cmp)]
|
386 |
pub fn write_f32<W: WriteBytesExt>(writer: &mut W, value: f32) -> std::io::Result<usize> {
|
414 |
/// Writes an [`Kind::Float`] atom with the given value.
|
415 |
#[allow(clippy::cast_possible_truncation, clippy::float_cmp)]
|
416 |
pub fn write_f64<W: WriteBytesExt>(writer: &mut W, value: f64) -> std::io::Result<usize> {
|
921 |
/// Reads an atom.
|
922 |
#[allow(clippy::cast_possible_truncation)]
|
923 |
pub fn read_atom<'de, R: Reader<'de>>(
|
99 |
let (_, high) = estimate_prime_pi(limit as u64);
|
100 |
#[allow(clippy::cast_possible_truncation)]
|
101 |
let len = high as usize;
|
231 |
let mut return_length = 0;
|
232 |
#[allow(clippy::cast_possible_truncation)]
|
233 |
unsafe {
|
188 |
let elapsed = now.saturating_duration_since(self.last);
|
189 |
#[allow(clippy::cast_possible_truncation)]
|
190 |
let elapsed_ticks = (elapsed.as_micros() / self.tick_duration.as_micros()) as u32;
|
63 |
match self {
|
64 |
#[allow(clippy::cast_possible_truncation)]
|
65 |
#[cfg(any(
|
72 |
Architecture::Arch8Bit => u8::from_ne_bytes(bytes.try_into().unwrap()) as usize,
|
73 |
#[allow(clippy::cast_possible_truncation)]
|
74 |
#[cfg(any(
|
80 |
Architecture::Arch16Bit => u16::from_ne_bytes(bytes.try_into().unwrap()) as usize,
|
81 |
#[allow(clippy::cast_possible_truncation)]
|
82 |
#[cfg(any(
|
87 |
Architecture::Arch32Bit => u32::from_ne_bytes(bytes.try_into().unwrap()) as usize,
|
88 |
#[allow(clippy::cast_possible_truncation)]
|
89 |
#[cfg(any(target_pointer_width = "64", target_pointer_width = "128"))]
|
90 |
Architecture::Arch64Bit => u64::from_ne_bytes(bytes.try_into().unwrap()) as usize,
|
91 |
#[allow(clippy::cast_possible_truncation)]
|
92 |
#[cfg(target_pointer_width = "128")]
|
60 |
fn put_address(&self, addr: usize, buf: &[u8]) -> std::io::Result<()> {
|
61 |
#[allow(clippy::cast_possible_truncation)]
|
62 |
let result = unsafe {
|
92 |
#[allow(clippy::cast_possible_truncation)]
|
93 |
async fn benchmark_message(
|
212 |
#[allow(clippy::cast_sign_loss)]
|
213 |
#[allow(clippy::cast_possible_truncation)]
|
214 |
impl MessageTest {
|
473 |
for i in 0..size {
|
474 |
#[allow(clippy::cast_possible_truncation)]
|
475 |
m.push(i as u8);
|
81 |
#[allow(clippy::cast_possible_truncation)]
|
82 |
impl ControlCommand {
|
373 |
let mut auth_buf = Vec::new();
|
374 |
#[allow(clippy::cast_possible_truncation)]
|
375 |
auth_buf.extend(
|
452 |
.await?;
|
453 |
#[allow(clippy::cast_possible_truncation)]
|
454 |
data_stream
|
679 |
msg_buf.extend(timestamp.to_le_bytes());
|
680 |
#[allow(clippy::cast_possible_truncation)]
|
681 |
msg_buf.extend((message.len() as u32).to_le_bytes());
|
184 |
#[allow(clippy::cast_possible_truncation)]
|
185 |
#[allow(clippy::mutable_key_type)]
|
678 |
if let Some(timestamp) = message.timestamp {
|
679 |
#[allow(clippy::cast_possible_truncation)]
|
680 |
let latency_mks = ((now_ns() - timestamp) / 1000) as u32;
|
55 |
/// Returns the "interactive" `scrypt` parameters as defined in libsodium.
|
56 |
#[allow(clippy::cast_possible_truncation)]
|
57 |
// ^-- conversion is safe; using `try_from` is impossible because of the const context.
|
73 |
/// Returns the "sensitive" `scrypt` parameters as defined in libsodium.
|
74 |
#[allow(clippy::cast_possible_truncation)]
|
75 |
// ^-- conversion is safe; using `try_from` is impossible because of the const context.
|
339 |
/// Based on `_PyLong_AsByteArray` in <https://github.com/python/cpython/blob/master/Objects/longobject.c>
|
340 |
#[allow(clippy::cast_possible_truncation)]
|
341 |
pub fn biguint_from_pylong_digits(digits: &[u16]) -> BigUint {
|
688 |
/// Based on `_PyLong_AsByteArray` in <https://github.com/python/cpython/blob/master/Objects/longobject.c>
|
689 |
#[allow(clippy::cast_possible_truncation)]
|
690 |
pub fn biguint_from_pylong_digits(digits: &[u16]) -> BigUint {
|
18 |
#[allow(clippy::cast_possible_truncation, unused_assignments, unused_variables)]
|
19 |
fn encode_impl<W: Writer, const N: usize>(mut buf: W, data: &[u8]) -> Result<usize>
|
127 |
#[inline]
|
128 |
#[allow(clippy::cast_possible_truncation)]
|
129 |
pub fn new(data: &'a (impl AsRef<[u8]> + ?Sized), width: u32, height: u32) -> Result<Self> {
|
119 |
#[inline]
|
120 |
#[allow(clippy::cast_lossless, clippy::cast_possible_truncation)]
|
121 |
pub fn hash_index(self) -> u8
|
10 |
impl Truncate for u16 {
|
11 |
#[allow(clippy::cast_possible_truncation)]
|
12 |
fn truncate_as_u8(self) -> u8 {
|
10 |
impl Truncate for u16 {
|
11 |
#[allow(clippy::cast_possible_truncation)]
|
12 |
fn truncate_as_u8(self) -> u8 {
|
74 |
pub fn new(anchor: Point<U>, depth: usize) -> Self {
|
75 |
#[allow(clippy::cast_possible_truncation)]
|
76 |
let width: U = Self::two().pow(depth as u32);
|
21 |
/// Returns the version number of the code, in the range `1...40`.
|
22 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation, cast_possible_wrap))]
|
23 |
pub fn version(&self) -> u8 {
|
27 |
/// Returns the mask ID of the code, in the range `0...7`.
|
28 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation, cast_possible_wrap))]
|
29 |
pub fn mask_id(&self) -> u8 {
|
33 |
/// Returns the ECI assignment number, in the range `0...30`.
|
34 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation, cast_possible_wrap))]
|
35 |
pub fn eci(&self) -> u8 {
|
8 |
/// Attempts to convert a `usize` to an `int` without overflow.
|
9 |
#[cfg_attr(feature = "cargo-clippy", allow(if_same_then_else, cast_possible_truncation, cast_possible_wrap))]
|
10 |
pub fn usize_to_int(n: usize) -> Result<c_int> {
|
20 |
/// Attempts to convert an `int` to a `usize` without under- or overflow.
|
21 |
#[cfg_attr(feature = "cargo-clippy", allow(if_same_then_else, cast_possible_truncation, cast_possible_wrap))]
|
22 |
pub fn int_to_usize(n: c_int) -> Result<usize> {
|
403 |
#[inline]
|
404 |
#[allow(clippy::cast_possible_truncation)]
|
405 |
pub fn reseed(&mut self, seed: u32) {
|
418 |
#[inline]
|
419 |
#[allow(clippy::cast_possible_truncation)]
|
420 |
pub fn reseed_with_key<I>(&mut self, key: I)
|
282 |
#[inline]
|
283 |
#[allow(clippy::cast_possible_truncation)]
|
284 |
pub fn next_u32(&mut self) -> u32 {
|
400 |
#[inline]
|
401 |
#[allow(clippy::cast_possible_truncation)]
|
402 |
pub fn reseed_with_key<I>(&mut self, key: I)
|
164 |
if let Some(h) = char::from(buf[read_idx + 1]).to_digit(16) {
|
165 |
#[allow(clippy::cast_possible_truncation)]
|
166 |
if let Some(l) = char::from(buf[read_idx + 2]).to_digit(16) {
|
59 |
/// <https://www.epochconverter.com/coredata>
|
60 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
61 |
impl From<f64> for DateTimeUtc {
|
116 |
#[allow(clippy::cast_possible_truncation)]
|
117 |
let lo = (len & u32::MAX as u64) as u32;
|
175 |
#[allow(clippy::cast_possible_truncation)]
|
176 |
let simd_prime = _mm256_set1_epi32(PRIME32[0] as i32);
|
254 |
let z = u128::from(x) * u128::from(y);
|
255 |
#[allow(clippy::cast_possible_truncation)]
|
256 |
(z as u64 ^ (z >> 64) as u64)
|
291 |
#[allow(clippy::cast_possible_truncation)]
|
292 |
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
467 |
let x3 = (*data.last().unwrap()) as u32;
|
468 |
#[allow(clippy::cast_possible_truncation)]
|
469 |
let x4 = data.len() as u32;
|
478 |
fn hash64_4to8(data: &[u8], secret: &[u8], mut seed: u64) -> u64 {
|
479 |
#[allow(clippy::cast_possible_truncation)]
|
480 |
let truncate_seed = seed as u32;
|
56 |
% <u64 as Redc>::SourceType::from(prime);
|
57 |
#[allow(clippy::cast_possible_truncation)]
|
58 |
{
|
88 |
}
|
89 |
#[allow(clippy::cast_possible_truncation)]
|
90 |
{
|
77 |
if v.fract() == 0.0 && v > 0.0 {
|
78 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] // checked above
|
79 |
self.visit_u64(v as u64)
|
123 |
if v.fract() == 0.0 && v > 0.0 {
|
124 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] // checked above
|
125 |
self.visit_u64(v as u64)
|
100 |
// (ep_end - offset) <= self.steps.len which fits in usize
|
101 |
#[allow(clippy::cast_possible_truncation)]
|
102 |
let ep_len = (ep_end - self.index_offset) as usize;
|
151 |
// (ep_end - offset) <= self.steps.len which fits in usize
|
152 |
#[allow(clippy::cast_possible_truncation)]
|
153 |
#[inline]
|
185 |
// used for (ep_end - offset) <= self.steps.len which fits in usize
|
186 |
#[allow(clippy::cast_possible_truncation)]
|
187 |
#[inline]
|
40 |
/// Evaluate a trained agent on the 0-1 deterministic bandit environment.
|
41 |
#[allow(clippy::cast_possible_truncation)]
|
42 |
#[allow(clippy::cast_sign_loss)]
|
150 |
#[allow(clippy::cast_possible_truncation)]
|
151 |
fn sample_environment(&self, rng: &mut Prng) -> Self::Environment {
|
88 |
#[allow(clippy::cast_possible_truncation)]
|
89 |
match summary {
|
109 |
#[allow(clippy::cast_possible_truncation)]
|
110 |
#[test]
|
379 |
#[allow(clippy::cast_possible_truncation)]
|
380 |
#[allow(clippy::cast_sign_loss)] // negative f64 casts to 0.0 as desired
|
61 |
#[allow(clippy::cast_possible_truncation)]
|
62 |
fn build_critic(&self, in_dim: usize, discount_factor: f64, device: Device) -> Self::Critic {
|
13 |
fn build_critic(&self, _in_dim: usize, discount_factor: f64, _device: Device) -> Self::Critic {
|
14 |
#[allow(clippy::cast_possible_truncation)]
|
15 |
RewardToGo {
|
97 |
#[allow(clippy::cast_possible_truncation)]
|
98 |
/// Returns a [`RetroPocket`] taking a string which contains as many letters representing the piece [`Role`](shakmaty::Role) in standard annotation, and a single number for the number of promotion, if any.
|
189 |
#[allow(clippy::cast_possible_truncation)]
|
190 |
if end <= start {
|
215 |
#[allow(clippy::cast_possible_truncation)]
|
216 |
if end < start {
|
255 |
let bit_value = (*value & (1 << bit)) != 0;
|
256 |
#[allow(clippy::cast_possible_truncation)]
|
257 |
let bit = bit as u8;
|
281 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
282 |
let offset = index as usize;
|
298 |
#[allow(clippy::cast_possible_truncation)]
|
299 |
let offset = abs_index as usize;
|
20 |
clippy::absurd_extreme_comparisons,
|
21 |
clippy::cast_possible_truncation
|
22 |
)]
|
56 |
clippy::cast_sign_loss,
|
57 |
clippy::cast_possible_truncation,
|
58 |
clippy::absurd_extreme_comparisons
|
601 |
if (0..=crate::MAX_USIZE_INT).contains(&num_params) {
|
602 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
603 |
let hash_script =
|
1157 |
return Ok(if (0..=crate::MAX_USIZE_INT).contains(&num_params) {
|
1158 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
1159 |
let hash_script = calc_fn_hash(None, &fn_name, num_params as usize);
|
930 |
#[cfg(not(feature = "no_index"))]
|
931 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
932 |
Expr::Index(x, ..) if !_chaining => match (&mut x.lhs, &mut x.rhs) {
|
348 |
let buffer_size = unsafe {
|
349 |
#[allow(clippy::cast_possible_truncation)]
|
350 |
#[allow(clippy::cast_possible_wrap)]
|
363 |
let buffer_size = unsafe {
|
364 |
#[allow(clippy::cast_possible_truncation)]
|
365 |
proc_pidpath(pid, name_chars.as_mut_ptr(), name_chars.len() as u32)
|
378 |
if unsafe {
|
379 |
#[allow(clippy::cast_possible_truncation)]
|
380 |
#[allow(clippy::cast_possible_wrap)]
|
403 |
{
|
404 |
#[allow(clippy::cast_possible_truncation)]
|
405 |
#[allow(clippy::cast_sign_loss)]
|
100 |
pub fn kill_internal(pid: usize) {
|
101 |
#[allow(clippy::cast_possible_truncation)]
|
102 |
#[allow(clippy::cast_possible_wrap)]
|
176 |
unsafe {
|
177 |
#[allow(clippy::cast_possible_truncation)]
|
178 |
if !EnumProcesses(
|
219 |
if tcp_table_entry.dwState == MIB_TCP_STATE_LISTEN {
|
220 |
#[allow(clippy::cast_possible_truncation)]
|
221 |
tcp_server_ports
|
238 |
let mut exe_image_path: Vec<u16> = vec![0; 256];
|
239 |
#[allow(clippy::cast_possible_truncation)]
|
240 |
loop {
|
355 |
// Launch program.
|
356 |
#[allow(clippy::cast_possible_truncation)]
|
357 |
let si = STARTUPINFOW {
|
409 |
pub fn kill_internal(pid: usize) {
|
410 |
#[allow(clippy::cast_possible_truncation)]
|
411 |
let process_handle =
|
1412 |
fn from(Rgb { r, g, b }: Rgb) -> Self {
|
1413 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
1414 |
Self(f32::from(b).mul_add(0.114, f32::from(r).mul_add(0.299, f32::from(g) * 0.587)) as u8)
|
35 |
#[allow(clippy::cast_possible_truncation)]
|
36 |
pub fn cursor_position(position: &Position) {
|
169 |
#[allow(clippy::cast_sign_loss)]
|
170 |
#[allow(clippy::cast_possible_truncation)]
|
171 |
#[inline]
|
210 |
// We are making sure that the minimum possible value is 0 so no sign loss will occur
|
211 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
212 |
self.get_ball_prediction_struct_for_slices(game, (time / Self::SIMULATION_DT).ceil() as usize)
|
268 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
269 |
let predicted_slices = (REQUESTED_TIME / Ball::SIMULATION_DT).ceil().max(0.) as usize;
|
48 |
// We have offset the values so they're all greater than 0
|
49 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
50 |
(Self::expand3(u.x as u32) | Self::expand3(u.y as u32) << 1 | Self::expand3(u.z as u32) << 2)
|
55 |
mod test {
|
56 |
#![allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
16 |
#[allow(clippy::identity_op, clippy::cast_possible_truncation)]
|
17 |
pub fn encode(mut output: impl BufMut, num: u32) -> usize {
|
116 |
#[allow(clippy::cast_possible_truncation)]
|
117 |
pub fn generate_set_holdings_bulk<V: VectorTrait<u8>>(
|
139 |
#[allow(clippy::cast_possible_truncation)]
|
140 |
pub fn generate_set_holdings_string<V: VectorTrait<u8>>(
|
161 |
#[allow(clippy::cast_possible_truncation)]
|
162 |
pub fn generate_set_coils_bulk<V: VectorTrait<u8>>(
|
223 |
}
|
224 |
#[allow(clippy::cast_possible_truncation)]
|
225 |
let crc = calc_crc16(buf, l as u8);
|
239 |
}
|
240 |
#[allow(clippy::cast_possible_truncation)]
|
241 |
let lrc = calc_lrc(buf, l as u8);
|
117 |
#[allow(clippy::cast_possible_truncation)]
|
118 |
#[allow(clippy::cast_sign_loss)]
|
169 |
}
|
170 |
#[allow(clippy::cast_possible_truncation)]
|
171 |
return Ok(len as u8);
|
195 |
} else {
|
196 |
#[allow(clippy::cast_possible_truncation)]
|
197 |
Ok(len as u8)
|
231 |
}
|
232 |
#[allow(clippy::cast_possible_truncation)]
|
233 |
return Ok(len as u8);
|
244 |
} else {
|
245 |
#[allow(clippy::cast_possible_truncation)]
|
246 |
Ok(len as u8)
|
20 |
#[allow(clippy::cast_possible_truncation)]
|
21 |
pub fn shred(path: &OsStr) -> Result<()> {
|
33 |
#[allow(clippy::cast_possible_truncation)]
|
34 |
const DEFAULT_DEGREE: u8 = 8 * size_of::<usize>() as u8;
|
227 |
#[allow(clippy::cast_possible_truncation)]
|
228 |
let shift = depth as u32 * degree.trailing_zeros();
|
232 |
let mask = degree as HashValue - 1;
|
233 |
#[allow(clippy::cast_possible_truncation)]
|
234 |
Some(((hash >> shift) & mask) as usize)
|
140 |
// Allowed because we slice `usize` into `u16` chunks
|
141 |
#[allow(clippy::cast_possible_truncation)]
|
142 |
fn rewind_cursor(stdout: &mut std::io::Stdout, amount: usize) -> Result<(), Error> {
|
158 |
// Allowed because we slice `usize` into `u16` chunks
|
159 |
#[allow(clippy::cast_possible_truncation)]
|
160 |
fn fast_forward_cursor(stdout: &mut std::io::Stdout, amount: usize) -> Result<(), Error> {
|
66 |
let mut carry = 0_u128;
|
67 |
#[allow(clippy::cast_possible_truncation)] // Intentional
|
68 |
for (lhs, rhs) in self.limbs.iter_mut().zip(rhs.limbs.into_iter()) {
|
102 |
let mut carry = 0_i128;
|
103 |
#[allow(clippy::cast_possible_truncation)] // Intentional
|
104 |
#[allow(clippy::cast_sign_loss)] // Intentional
|
71 |
#[inline(always)]
|
72 |
#[allow(clippy::cast_possible_truncation)]
|
73 |
fn low(self) -> u64 {
|
5 |
#[allow(clippy::cast_possible_truncation)] // Intentional truncation.
|
6 |
#[allow(dead_code)] // Used for testing
|
23 |
let mut carry = 0;
|
24 |
#[allow(clippy::cast_possible_truncation)] // Intentional
|
25 |
for j in 0..m.len() {
|
29 |
}
|
30 |
#[allow(clippy::cast_possible_truncation)] // Intentional
|
31 |
for j in m.len()..(temp.len() - i) {
|
59 |
let mut carry = 0;
|
60 |
#[allow(clippy::cast_possible_truncation)] // Intentional
|
61 |
#[allow(clippy::cast_sign_loss)] // Intentional
|
101 |
let mut carry: u128 = u128::from(digit);
|
102 |
#[allow(clippy::cast_possible_truncation)]
|
103 |
for limb in result.limbs.iter_mut() {
|
100 |
#[allow(clippy::cast_lossless)]
|
101 |
#[allow(clippy::cast_possible_truncation)]
|
102 |
for limb in &mut limbs {
|
55 |
/// Refresh and return battery percentage.
|
56 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
57 |
fn refresh_percentage(&mut self) -> u8 {
|
168 |
/// Return current battery percentage of the given `battery::Battery` device.
|
169 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
170 |
fn fetch_percentage(device: &battery::Battery) -> u8 {
|
476 |
) -> Result<KeyEvent> {
|
477 |
#[allow(clippy::cast_possible_truncation)]
|
478 |
match digit {
|
489 |
let key = rdr.next_key(true)?;
|
490 |
#[allow(clippy::cast_possible_truncation)]
|
491 |
match key {
|
659 |
#[allow(clippy::cast_possible_truncation)]
|
660 |
fn vi_arg_digit<R: RawReader>(
|
476 |
) -> Result<KeyEvent> {
|
477 |
#[allow(clippy::cast_possible_truncation)]
|
478 |
match digit {
|
489 |
let key = rdr.next_key(true)?;
|
490 |
#[allow(clippy::cast_possible_truncation)]
|
491 |
match key {
|
659 |
#[allow(clippy::cast_possible_truncation)]
|
660 |
fn vi_arg_digit<R: RawReader>(
|
32 |
#[allow(clippy::cast_possible_truncation)]
|
33 |
pub fn cursor_position(position: &Position) {
|
282 |
#[allow(clippy::cast_possible_truncation)]
|
283 |
fn instance_bitmap(metadata: usize) -> u32 {
|
287 |
#[allow(clippy::cast_possible_truncation)]
|
288 |
fn owned_bitmap(metadata: usize) -> u32 {
|
174 |
/// Searches the given data block for an entry matching the key.
|
175 |
#[allow(clippy::cast_possible_truncation)]
|
176 |
fn search_entry<'b, Q, const LEN: usize>(
|
23 |
/// Returns the partial hash value of the given hash.
|
24 |
#[allow(clippy::cast_possible_truncation)]
|
25 |
#[inline]
|
57 |
.cast::<Bucket<K, V, LOCK_FREE>>();
|
58 |
#[allow(clippy::cast_possible_truncation)]
|
59 |
let bucket_array_ptr_offset = bucket_array_ptr_offset as u32;
|
156 |
/// Calculates the [`Bucket`] index for the hash value.
|
157 |
#[allow(clippy::cast_possible_truncation)]
|
158 |
#[inline]
|
163 |
/// Calculates `log_2` of the array size from the given capacity.
|
164 |
#[allow(clippy::cast_possible_truncation)]
|
165 |
fn calculate_log2_array_size(capacity: usize) -> u8 {
|
68 |
#[allow(clippy::cast_possible_truncation)]
|
69 |
#[allow(clippy::cast_sign_loss)]
|
87 |
#[allow(clippy::cast_possible_truncation)]
|
88 |
RNG.try_with(|rng| {
|
32 |
#![allow(clippy::cast_precision_loss)]
|
33 |
#![allow(clippy::cast_possible_truncation)]
|
34 |
#![allow(clippy::cast_sign_loss)]
|
177 |
#[allow(clippy::cast_sign_loss)]
|
178 |
#[allow(clippy::cast_possible_truncation)]
|
179 |
#[inline]
|
574 |
pub fn new() -> Self {
|
575 |
#[allow(clippy::cast_possible_truncation)]
|
576 |
let empty_size = core::mem::size_of::<win::ACL>() as u32;
|
585 |
pub fn add_allowed_ace(&mut self, sid_size: u32) {
|
586 |
#[allow(clippy::cast_possible_truncation)]
|
587 |
let ace_header_size = core::mem::size_of::<win::ACCESS_ALLOWED_ACE>() as u32;
|
600 |
pub fn add_denied_ace(&mut self, sid_size: u32) {
|
601 |
#[allow(clippy::cast_possible_truncation)]
|
602 |
let ace_header_size = core::mem::size_of::<win::ACCESS_DENIED_ACE>() as u32;
|
478 |
#[allow(clippy::cast_possible_truncation)]
|
479 |
fn serialize_i128(self, v: i128) -> Result<Yaml> {
|
507 |
#[allow(clippy::cast_possible_truncation)]
|
508 |
fn serialize_u128(self, v: u128) -> Result<Yaml> {
|
99 |
/// The number should contain the components in RGBA order.
|
100 |
#[allow(clippy::cast_possible_truncation)]
|
101 |
fn from(src: u32) -> Self {
|
162 |
/// For each `X` in `rgba`, `result.X = a.X * b.X / 255`.
|
163 |
#[allow(clippy::cast_possible_truncation)]
|
164 |
fn mul(self, other: Color) -> Color {
|
64 |
#[must_use]
|
65 |
#[allow(clippy::cast_possible_truncation)]
|
66 |
pub fn seconds(seconds: f32) -> Self {
|
89 |
#[must_use]
|
90 |
#[allow(clippy::cast_possible_truncation)]
|
91 |
pub fn as_milliseconds(self) -> i32 {
|
118 |
#[allow(clippy::cast_possible_truncation)]
|
119 |
fn debase(&self, x: &str) -> Result<usize> {
|
25 |
let image_height_f = f64::from(image_width) / aspect_ratio;
|
26 |
#[allow(clippy::cast_possible_truncation)]
|
27 |
let image_height = image_height_f as i32;
|
75 |
/// If there is an error writing to stdout.
|
76 |
#[allow(clippy::cast_possible_truncation)]
|
77 |
#[inline]
|
84 |
#[cfg_attr(not(feature = "no-inline"), inline)]
|
85 |
#[allow(clippy::cast_possible_truncation)]
|
86 |
pub fn codepoint_to_utf8(cp: u32, c: &mut [u8]) -> usize {
|
529 |
//#[inline(never)]
|
530 |
#[allow(clippy::cast_possible_truncation)]
|
531 |
pub(crate) unsafe fn find_structural_bits(
|
595 |
// and flatten
|
596 |
#[allow(clippy::cast_possible_truncation)]
|
597 |
SimdInput::flatten_bits(&mut structural_indexes, idx as u32, structurals);
|
355 |
#[allow(
|
356 |
clippy::cast_possible_truncation,
|
357 |
clippy::cast_sign_loss,
|
27 |
#[cfg_attr(not(feature = "no-inline"), inline)]
|
28 |
#[allow(clippy::cast_possible_truncation)]
|
29 |
fn multiply_as_u128(a: u64, b: u64) -> (u64, u64) {
|
37 |
clippy::cast_possible_wrap,
|
38 |
clippy::cast_possible_truncation,
|
39 |
clippy::too_many_lines
|
276 |
clippy::cast_sign_loss,
|
277 |
clippy::cast_possible_truncation,
|
278 |
clippy::cast_precision_loss,
|
90 |
#[cfg_attr(not(feature = "no-inline"), inline)]
|
91 |
#[allow(clippy::cast_possible_truncation)]
|
92 |
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value>
|
99 |
#[cfg_attr(not(feature = "no-inline"), inline)]
|
100 |
#[allow(clippy::cast_possible_truncation)]
|
101 |
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value>
|
108 |
#[cfg_attr(not(feature = "no-inline"), inline)]
|
109 |
#[allow(clippy::cast_possible_truncation)]
|
110 |
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value>
|
4 |
pub(crate) fn validate_utf8_at_offset(input: &[u8], offset: usize) -> Result<(), Utf8ErrorCompat> {
|
5 |
#[allow(clippy::cast_possible_truncation)]
|
6 |
match core::str::from_utf8(&input[offset..]) {
|
422 |
// We round the f64 before casting to i64, so this lint is unnecessary here.
|
423 |
#[allow(clippy::cast_possible_truncation)]
|
424 |
let p = ((points / results.len() as f64) * 100.0).round() as i64;
|
68 |
#[allow(clippy::cast_possible_truncation)]
|
69 |
#[allow(clippy::cast_sign_loss)]
|
87 |
#[allow(clippy::cast_possible_truncation)]
|
88 |
RNG.try_with(|rng| {
|
177 |
#[allow(clippy::cast_sign_loss)]
|
178 |
#[allow(clippy::cast_possible_truncation)]
|
179 |
#[inline]
|
1013 |
#[allow(clippy::cast_possible_truncation)]
|
1014 |
let fail_seed = std::cmp::max(3, time_now.as_nanos() as u32 % 128);
|
1181 |
#[allow(clippy::cast_possible_truncation)]
|
1182 |
let fail_seed = std::cmp::max(3, time_now.as_nanos() as u32 % 128);
|
64 |
pub fn new(file: File, buffer_size: u64) -> Self {
|
65 |
#[allow(clippy::cast_possible_truncation)] // Cast has to be save, should not ever panic
|
66 |
Self {
|
79 |
const BUFFER_SIZE: u64 = 100_000;
|
80 |
#[allow(clippy::cast_possible_truncation)] // Cast has to be save, should not ever panic
|
81 |
const BUFF_U: usize = BUFFER_SIZE as usize;
|
101 |
let remain = file_len - offset;
|
102 |
#[allow(clippy::cast_possible_truncation)] // Cast has to be save, should not ever panic
|
103 |
let mut buffer_last = vec![0; remain as usize];
|
504 |
#[inline]
|
505 |
#[allow(clippy::cast_possible_truncation)]
|
506 |
fn tree_depth<const DEPTH: u8>(tree_size: usize) -> Result<u8> {
|
115 |
/// The maximum number of fields in data (must not exceed u16::MAX).
|
116 |
#[allow(clippy::cast_possible_truncation)]
|
117 |
const MAX_DATA_SIZE_IN_FIELDS: u32 = ((128 * 1024 * 8) / Field::<Self>::SIZE_IN_DATA_BITS) as u32;
|
96 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
97 |
fn script_splitn(s: &str, n: INT, pattern: &str) -> Vec<Dynamic> {
|
103 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
104 |
fn script_rsplitn(s: &str, n: INT, pattern: &str) -> Vec<Dynamic> {
|
166 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
167 |
fn script_require(arr: &Array, n: INT) -> ScriptResult<bool> {
|
268 |
engine.register_fn("to_string", |this: &mut Import| this.path.clone());
|
269 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
270 |
engine.register_fn("NL", |count: i64| "\n".repeat(count as usize));
|
271 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
272 |
engine.register_fn("IND", move |count: i64| indent.repeat(count as usize));
|
72 |
// it's ok to truncate the hash.
|
73 |
#[allow(clippy::cast_possible_truncation)]
|
74 |
let hash = hasher.finish() as usize;
|
14 |
// if this was mmaped, there will be no truncation.
|
15 |
#[allow(clippy::cast_possible_truncation)]
|
16 |
let mut buf = vec![0_u8; length as usize];
|
35 |
// if this was mmaped, there will be no truncation.
|
36 |
#[allow(clippy::cast_possible_truncation)]
|
37 |
self.get_buf()
|
43 |
// if this was mmaped, there will be no truncation.
|
44 |
#[allow(clippy::cast_possible_truncation)]
|
45 |
self.buf
|
248 |
// if it was mmaped, it won't truncate
|
249 |
#[allow(clippy::cast_possible_truncation)]
|
250 |
&mmap
|
393 |
// if it was mmaped, it won't truncate
|
394 |
#[allow(clippy::cast_possible_truncation)]
|
395 |
&mmap
|
611 |
// if it was mmaped, it won't truncate
|
612 |
#[allow(clippy::cast_possible_truncation)]
|
613 |
let index = MemIndex::from_static_buf(
|
653 |
// if it was mmaped, it won't truncate
|
654 |
#[allow(clippy::cast_possible_truncation)]
|
655 |
let buf = &self.mmap[offset as usize..right_bound as usize];
|
44 |
fn put_data(&mut self, data: &[u8]) -> Result<(u32, u32)> {
|
45 |
#[allow(clippy::cast_possible_truncation)]
|
46 |
let len = data.len() as u32;
|
162 |
#[allow(clippy::cast_possible_truncation)]
|
163 |
let mut value = memory
|
246 |
let room_id = room_id.as_bytes();
|
247 |
#[allow(clippy::cast_possible_truncation)]
|
248 |
let len = room_id.len() as u32;
|
49 |
#[must_use]
|
50 |
#[allow(clippy::cast_possible_truncation)]
|
51 |
pub fn new(object: u64, iter_length: u8) -> BitIterator {
|
259 |
#[inline(always)]
|
260 |
#[allow(clippy::inline_always, clippy::cast_possible_truncation)]
|
261 |
pub fn u128_lo(u: u128) -> u64 {
|
266 |
#[inline(always)]
|
267 |
#[allow(clippy::inline_always, clippy::cast_possible_truncation)]
|
268 |
pub fn u128_hi(u: u128) -> u64 {
|
226 |
// u64 should be the same size as a usize
|
227 |
#[allow(clippy::cast_possible_truncation)] {
|
228 |
(masked.wrapping_mul(self.magic) >> self.shift) as _
|
195 |
const fn extract(self, shift: u8, mask: u8) -> u8 {
|
196 |
#[allow(clippy::cast_possible_truncation)] {
|
197 |
(self.0 >> shift) as u8 & mask
|
63 |
// _max_height is at least -1, so +1 is a least 0 - and it can never be higher than usize
|
64 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
65 |
pub fn update_height(&mut self) {
|
23 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
24 |
impl From<EntryAndIntermediateExcerpts> for Result {
|
56 |
// impossible.
|
57 |
#[allow(clippy::cast_possible_truncation)]
|
58 |
let result = f64::floor(lg) as usize + 1;
|
1701 |
#[allow(clippy::cast_possible_truncation)]
|
1702 |
const BYTES_PER_WRITE: usize = 2 * IEC::Ki as usize * SECTOR_SIZE;
|
191 |
// exactly one vs. 1024 KiB for 0.99 MiB.
|
192 |
#[allow(clippy::cast_possible_truncation)]
|
193 |
// This is allowed because the maximum value possible of
|
68 |
#[allow(
|
69 |
clippy::cast_possible_truncation,
|
70 |
clippy::cast_sign_loss,
|
79 |
#[allow(
|
80 |
clippy::cast_possible_truncation,
|
81 |
clippy::cast_sign_loss,
|
74 |
/// the spans but this function is inspired from the later.
|
75 |
#[allow(clippy::cast_possible_truncation)]
|
76 |
#[must_use]
|
673 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
674 |
let num_segments = (angle_extent.abs() * 2.0 / f64::consts::PI).ceil() as u64;
|
217 |
// we know this is within bounds
|
218 |
#[allow(clippy::cast_possible_truncation)]
|
219 |
let face = Face::from(face_idx as u8);
|
114 |
#[cfg(feature = "generation")]
|
115 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss, clippy::cast_precision_loss)]
|
116 |
pub fn populate(&mut self, mine_percentage: f64, safe_spot: Option<FieldCoordinates>) {
|
57 |
#[allow(clippy::cast_sign_loss)]
|
58 |
#[allow(clippy::cast_possible_truncation)]
|
59 |
#[allow(clippy::cast_precision_loss)]
|
182 |
#[inline]
|
183 |
#[allow(clippy::cast_possible_truncation)]
|
184 |
pub const fn fetch_discriminant(pointer: usize) -> Discriminant {
|
142 |
#[allow(clippy::cast_possible_truncation)]
|
143 |
self.tokens.push(SemanticToken {
|
272 |
// idle for 136 years
|
273 |
#[allow(clippy::cast_possible_truncation)]
|
274 |
Some(crate::protocol::Session {
|
116 |
#[allow(clippy::cast_possible_truncation)]
|
117 |
Some(std::char::from_u32(('a' as u32) + (i as u32)).unwrap())
|
64 |
#[inline]
|
65 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
66 |
// Allow(clippy::cast_sign_loss, clippy::cast_possible_truncation): The bounds have been previously
|
47 |
/// Encode the initial handshake message (i.e. first one sent by both peers)
|
48 |
#[allow(clippy::cast_possible_truncation)]
|
49 |
#[must_use]
|
509 |
/// Encrypt AEAD authenticated data
|
510 |
#[allow(clippy::cast_possible_truncation)]
|
511 |
fn encrypt(
|
190 |
clippy::cast_possible_wrap,
|
191 |
clippy::cast_possible_truncation,
|
192 |
clippy::needless_pass_by_value
|
301 |
clippy::cast_possible_wrap,
|
302 |
clippy::cast_possible_truncation,
|
303 |
clippy::needless_pass_by_value
|
351 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
352 |
fn lead(s: [usize; 2]) -> (MatrixOp, i32) {
|
44 |
/// If the vectors do not have the same length
|
45 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
46 |
pub fn dot_using<C: BLASContext<Device = S::Device>>(
|
92 |
clippy::cast_possible_wrap,
|
93 |
clippy::cast_possible_truncation,
|
94 |
clippy::needless_pass_by_value
|
147 |
/// Vector scaling, using the specified [`BLASContext`]
|
148 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
149 |
pub fn scale_using<C: BLASContext<Device = S::Device>>(&mut self, alpha: S::T, ctx: C)
|
163 |
clippy::cast_possible_wrap,
|
164 |
clippy::cast_possible_truncation,
|
165 |
clippy::needless_pass_by_value
|
11 |
/// Tries to convert an `f64` number to `i64` without precision loss.
|
12 |
#[allow(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
|
13 |
fn to_i64(value: f64) -> Option<i64> {
|
40 |
///
|
41 |
#[allow(clippy::cast_possible_truncation)]
|
42 |
pub fn new<D>(channels: u16, sample_rate: u32, data: D) -> SamplesBuffer<S>
|
68 |
clippy::cast_sign_loss,
|
69 |
clippy::cast_possible_truncation,
|
70 |
clippy::cast_precision_loss
|
87 |
clippy::cast_sign_loss,
|
88 |
clippy::cast_possible_truncation
|
89 |
)]
|
117 |
clippy::cast_possible_wrap,
|
118 |
clippy::cast_possible_truncation,
|
119 |
clippy::cast_lossless
|
159 |
#[inline]
|
160 |
#[allow(clippy::cast_possible_truncation)]
|
161 |
fn channels(&self) -> u16 {
|
180 |
#[inline]
|
181 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
182 |
fn seek(&mut self, time: Duration) -> Option<Duration> {
|
7 |
clippy::cast_sign_loss,
|
8 |
clippy::cast_possible_truncation,
|
9 |
clippy::cast_lossless,
|
98 |
clippy::cast_precision_loss,
|
99 |
clippy::cast_possible_truncation,
|
100 |
clippy::cast_sign_loss
|
350 |
clippy::cast_sign_loss,
|
351 |
clippy::cast_possible_truncation,
|
352 |
clippy::cast_lossless
|
84 |
#[inline]
|
85 |
#[allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
86 |
pub fn append<S>(&self, source: S)
|
647 |
// `directions.len() <= Resolution::Fifteen`, checked above.
|
648 |
#[allow(clippy::cast_possible_truncation)]
|
649 |
let resolution = directions.len() as u8;
|
666 |
// `directions.len()`, and thus `i`, is 15 at most which fit in u8.
|
667 |
#[allow(clippy::cast_possible_truncation)]
|
668 |
let resolution = (i + 1) as u8; // Directions start at res 1.
|
708 |
/// Returns the index of the first child, if any.
|
709 |
#[allow(clippy::cast_possible_truncation)] // 64 zeros max, can't overflow.
|
710 |
const fn first_child_index(self) -> u8 {
|
16 |
};
|
17 |
#[allow(clippy::cast_possible_truncation)]
|
18 |
let mut val = alphabet.find(c)? as u8;
|
323 |
);
|
324 |
#[allow(clippy::cast_possible_truncation)]
|
325 |
let len = enc_packet.len() as u16;
|
371 |
#[allow(clippy::cast_possible_truncation)]
|
372 |
let timestamp = now.as_secs() as u32;
|
385 |
#[allow(clippy::cast_possible_truncation)]
|
386 |
let pad = randombytes::randombytes_uniform(32) as u8;
|
128 |
/// - if the provided string isn't a number
|
129 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
130 |
pub fn parse_as_minutes(unparsed: &str) -> Result<Duration, impl Error> {
|
125 |
#[allow(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
|
126 |
fn rounded_division(value: i64, units: &str, divide_by: f64) -> String {
|
284 |
/// This method calls [`fastrand::u8`] 8 times. Twice as fast as [`TinyId::random_fastrand2`].
|
285 |
#[allow(clippy::cast_possible_truncation, unused)]
|
286 |
#[cfg_attr(coverage, no_coverage)]
|
27 |
/// Generates a new color from the given r g b values
|
28 |
#[allow(clippy::cast_possible_truncation)]
|
29 |
#[must_use]
|
87 |
#[allow(clippy::cast_possible_truncation)]
|
88 |
fn calculate_hash<T: Hash>(t: &T) -> u32 {
|
18 |
#[allow(clippy::cast_possible_truncation)]
|
19 |
fn u16_len(len: usize) -> u16 {
|
27 |
#[allow(clippy::cast_possible_truncation)]
|
28 |
fn u8_len(len: usize) -> u8 {
|
834 |
#[allow(clippy::cast_possible_truncation)]
|
835 |
fn encode(&mut self, item: Message, dst: &mut BytesMut) -> Result<(), Self::Error> {
|
927 |
#[allow(clippy::cast_possible_truncation, clippy::too_many_lines)]
|
928 |
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
|
110 |
/// Encode a length in ASN.1.
|
111 |
#[allow(clippy::cast_possible_truncation)]
|
112 |
fn asn1_encode_len(n: usize) -> Vec<u8> {
|
125 |
/// Encode an object identifier in ASN.1.
|
126 |
#[allow(clippy::cast_possible_truncation)]
|
127 |
fn asn1_encode_oid(oid: &[u64]) -> Vec<u8> {
|
135 |
/// Encode an integer as a variable-length quality (used in ASN.1 encoding of object identifiers).
|
136 |
#[allow(clippy::cast_possible_truncation)]
|
137 |
fn to_vlq(n: u64) -> Vec<u8> {
|
20 |
let mut cipher = vec![];
|
21 |
#[allow(clippy::cast_possible_truncation)]
|
22 |
cipher.write_u32::<BigEndian>(len as u32)?;
|
1225 |
#[allow(clippy::cast_sign_loss)]
|
1226 |
#[allow(clippy::cast_possible_truncation)]
|
1227 |
let size = ((*factor - 1.0) * collection.capacity() as f64).floor() as usize;
|
17 |
#[must_use]
|
18 |
#[allow(clippy::cast_possible_truncation)]
|
19 |
pub fn nanotime() -> u64 {
|
21 |
#[allow(clippy::cast_possible_truncation)]
|
22 |
pub(crate) fn to_lsp_position(location: &language::Location) -> Position {
|
24 |
// We are truncating for so we can write parts of the values
|
25 |
#[allow(clippy::cast_possible_truncation)]
|
26 |
fn write_bits_be(
|
132 |
// We allow truncation since we want to cut down the size of values
|
133 |
#[allow(clippy::cast_possible_truncation)]
|
134 |
fn write_bits_le(
|
190 |
clippy::cast_lossless,
|
191 |
clippy::cast_possible_truncation,
|
192 |
clippy::cast_sign_loss,
|
316 |
/// on io errors
|
317 |
#[allow(clippy::cast_possible_truncation, clippy::too_many_lines)]
|
318 |
fn highlight_errors_indent(
|
357 |
#[allow(
|
358 |
clippy::cast_possible_truncation,
|
359 |
clippy::cast_sign_loss,
|
42 |
// ALLOW: Until we have u64 support in clippy
|
43 |
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
44 |
pub fn load(registry: &mut Registry) {
|
19 |
// ALLOW: Until we have u64 support in clippy
|
20 |
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
21 |
pub fn load(registry: &mut Registry) {
|
619 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
620 |
let v = v as u64; // TODO add f64 support to HDR Histogram create - oss
|
131 |
#[allow(
|
132 |
clippy::cast_possible_truncation,
|
133 |
clippy::cast_precision_loss,
|
139 |
clippy::cast_sign_loss,
|
140 |
clippy::cast_possible_truncation,
|
141 |
clippy::cast_precision_loss
|
230 |
clippy::only_used_in_recursion,
|
231 |
clippy::cast_possible_truncation
|
232 |
)]
|
352 |
{
|
353 |
#[allow(clippy::cast_possible_truncation)]
|
354 |
fn poll_read(
|
393 |
// FIXME: replace usize to u64
|
394 |
#[allow(clippy::cast_possible_truncation)]
|
395 |
fn finalize_block_size(buf_size: Option<usize>, meta: &Metadata) -> usize {
|
327 |
let has_selection = !state.selected.is_empty();
|
328 |
#[allow(clippy::cast_possible_truncation)]
|
329 |
for item in visible.iter().skip(state.offset).take(end - start) {
|
42 |
// Filter out elapsed instants.
|
43 |
#[allow(clippy::cast_possible_truncation)]
|
44 |
let used_permits = self
|
53 |
/// Maximum number of available permits.
|
54 |
#[allow(clippy::cast_possible_truncation)]
|
55 |
pub fn max(&self) -> u8 {
|
111 |
// Round up to be on the safe side.
|
112 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
113 |
let heartbeats_per_reset = heartbeats_per_reset.ceil() as u8;
|
86 |
fn request(&'_ self, shard_id: [u64; 2]) -> Pin<Box<dyn Future<Output = ()> + Send + '_>> {
|
87 |
#[allow(clippy::cast_possible_truncation)]
|
88 |
let bucket = (shard_id[0] % (self.buckets.len() as u64)) as usize;
|
117 |
// (id % 10) will always be less than 10 so truncation cannot happen.
|
118 |
#[allow(clippy::cast_possible_truncation)]
|
119 |
let ascii = (id % 10) as u8 + ASCII_NUMBER;
|
124 |
// (id % 10) will always be less than 10 so truncation cannot happen.
|
125 |
#[allow(clippy::cast_possible_truncation)]
|
126 |
let ascii = (id % 10) as u8 + ASCII_NUMBER;
|
489 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
490 |
reset.replace((reset_value * 1000.).ceil() as u64);
|
495 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
496 |
reset_after.replace((reset_after_value * 1000.).ceil() as u64);
|
421 |
/// number means it is more heavily loaded.
|
422 |
#[allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)]
|
423 |
pub async fn penalty(&self) -> i32 {
|
153 |
OutgoingEvent::Volume(event) => {
|
154 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
155 |
self.volume.store(event.volume, Ordering::Release);
|
70 |
/// Derived from bits 17..21 of the id.
|
71 |
#[allow(clippy::cast_possible_truncation)]
|
72 |
fn worker_id(&self) -> u8 {
|
78 |
/// Derived from bits 12..16 of the id.
|
79 |
#[allow(clippy::cast_possible_truncation)]
|
80 |
fn process_id(&self) -> u8 {
|
87 |
/// Derived from bits 0..11 of the id.
|
88 |
#[allow(clippy::cast_possible_truncation)]
|
89 |
fn increment(&self) -> u16 {
|
249 |
} else {
|
250 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
251 |
let split_len = (self.payload_length as usize) - app_data_len;
|
304 |
if len < TWO_EXT as u64 {
|
305 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
306 |
let cast_len = len as u8;
|
311 |
let mut len_buf = BytesMut::with_capacity(2);
|
312 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
313 |
let cast_len = len as u16;
|
129 |
if tok_len < 253 {
|
130 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
131 |
let len = tok_len as u8;
|
137 |
let mut actual_len = Vec::with_capacity(2);
|
138 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
139 |
let cast_len = tok_len as u16;
|
145 |
let mut actual_len = Vec::with_capacity(4);
|
146 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
147 |
let cast_len = tok_len as u32;
|
153 |
let mut actual_len = Vec::with_capacity(8);
|
154 |
#[cfg_attr(feature = "cargo-clippy", allow(cast_possible_truncation))]
|
155 |
let cast_len = tok_len as u64;
|
146 |
// Will not panic; above guarantees `self.size - self.offset` is less than usize, else buf.len() could not return.
|
147 |
#[allow(clippy::cast_possible_truncation)]
|
148 |
&mut buf[..(self.size - self.offset) as usize]
|
71 |
#[inline]
|
72 |
#[allow(clippy::cast_possible_truncation)] // Clippy is not smart enough to realize this can/t fail
|
73 |
pub(crate) const fn get(self) -> usize {
|
103 |
#[allow(clippy::cast_possible_truncation)]
|
104 |
const fn u32_to_u8_array(x: u32) -> [u8; 4] {
|
508 |
) -> Result<(), minicbor::encode::Error<W::Error>> {
|
509 |
#[allow(clippy::cast_possible_truncation)]
|
510 |
e.array(5)?
|
648 |
#[allow(clippy::cast_possible_truncation)]
|
649 |
let sequence = sequence as u32;
|
7 |
#[allow(clippy::cast_possible_truncation)]
|
8 |
#[allow(clippy::cast_precision_loss)]
|
24 |
#[allow(clippy::cast_precision_loss)]
|
25 |
#[allow(clippy::cast_possible_truncation)]
|
26 |
impl Xoshiro256 {
|
87 |
impl super::Xoshiro256 {
|
88 |
#[allow(clippy::cast_possible_truncation)]
|
89 |
fn next_byte(&mut self) -> u8 {
|
91 |
#[allow(clippy::cast_possible_truncation)] // It fits.
|
92 |
#[must_use]
|
263 |
#[allow(clippy::cast_possible_truncation)] // It fits.
|
264 |
/// # Set Date/Time.
|
756 |
#[allow(clippy::cast_possible_truncation)] // It fits.
|
757 |
/// # Subtraction.
|
17 |
#[allow(clippy::cast_possible_truncation)] // It fits.
|
18 |
#[allow(clippy::integer_division)]
|
198 |
#[allow(clippy::cast_possible_truncation)] // It fits.
|
199 |
/// # Parse Time From Seconds.
|
173 |
#[allow(clippy::cast_lossless, clippy::cast_possible_truncation)] // It fits.
|
174 |
#[must_use]
|
192 |
#[allow(clippy::cast_possible_truncation)] // It fits.
|
193 |
#[allow(clippy::integer_division)] // We want it.
|
9 |
#[allow(clippy::cast_lossless)]
|
10 |
#[allow(clippy::cast_possible_truncation)]
|
11 |
#[allow(clippy::cast_sign_loss)]
|
11 |
#[allow(trivial_casts)]
|
12 |
#[allow(clippy::cast_possible_truncation)]
|
13 |
#[allow(clippy::cast_sign_loss)]
|
10 |
#[allow(clippy::cast_possible_truncation)]
|
11 |
#[allow(clippy::cast_possible_wrap)]
|
9 |
#[allow(clippy::cast_possible_truncation)]
|
10 |
#[allow(clippy::cast_sign_loss)]
|
579 |
/// Tries to represent the value as a f32
|
580 |
#[allow(clippy::cast_possible_truncation)]
|
581 |
#[inline]
|
128 |
#[allow(clippy::cast_possible_truncation)]
|
129 |
#[allow(clippy::cast_possible_wrap)]
|
102 |
#[allow(clippy::cast_possible_truncation)]
|
103 |
#[allow(clippy::cast_possible_wrap)]
|
14 |
/// This function panics if the supplied width and height does not match the buffer size.
|
15 |
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
16 |
#[must_use]
|
657 |
clippy::cast_sign_loss,
|
658 |
clippy::cast_possible_truncation
|
659 |
)]
|
965 |
/// ```
|
966 |
#[allow(clippy::similar_names, clippy::cast_possible_truncation)]
|
967 |
pub fn thick_line(
|
129 |
#[allow(clippy::cast_possible_truncation)]
|
130 |
if self.state.is_down {
|
156 |
#[allow(clippy::cast_possible_truncation)]
|
157 |
if self.state.is_down {
|
177 |
/// Initiate a flood fiil at current position.
|
178 |
#[allow(clippy::cast_possible_truncation)]
|
179 |
pub fn flood_fill(&mut self) -> &mut Self {
|
94 |
/// * higher density where gradients are bigger.
|
95 |
#[allow(clippy::cast_possible_truncation)]
|
96 |
#[allow(clippy::cast_sign_loss)]
|
154 |
/// Pick candidates at all the block levels.
|
155 |
#[allow(clippy::cast_possible_truncation)]
|
156 |
fn pick_all_block_candidates<T: Number<T>>(
|
282 |
#[allow(clippy::cast_sign_loss)]
|
283 |
#[allow(clippy::cast_possible_truncation)]
|
284 |
fn region_thresholds<T: Number<T>>(median_gradients: &DMatrix<T>, coefs: (Float, T)) -> DMatrix<T> {
|
35 |
/// Compute squared gradient norm from x and y gradient matrices.
|
36 |
#[allow(clippy::cast_possible_truncation)]
|
37 |
#[allow(clippy::cast_sign_loss)]
|
46 |
/// Compute squared gradient norm directly from the image.
|
47 |
#[allow(clippy::cast_possible_truncation)]
|
48 |
#[allow(clippy::cast_sign_loss)]
|
99 |
/// b d
|
100 |
#[allow(clippy::cast_possible_truncation)]
|
101 |
#[allow(clippy::cast_sign_loss)]
|
34 |
#[allow(clippy::cast_precision_loss)]
|
35 |
#[allow(clippy::cast_possible_truncation)]
|
36 |
#[allow(clippy::cast_sign_loss)]
|
19 |
/// Some precision is also left to keep the pyramid data as `u8`.
|
20 |
#[allow(clippy::cast_possible_truncation)]
|
21 |
pub fn mean_pyramid(max_levels: usize, mat: DMatrix<u8>) -> Vec<DMatrix<u8>> {
|
223 |
#[allow(clippy::many_single_char_names)]
|
224 |
#[allow(clippy::cast_possible_truncation)]
|
225 |
#[allow(clippy::cast_sign_loss)]
|
15 |
#[allow(clippy::cast_possible_truncation)]
|
16 |
#[allow(clippy::cast_sign_loss)]
|
68 |
#[allow(clippy::cast_possible_truncation)]
|
69 |
#[allow(clippy::cast_sign_loss)]
|
87 |
#[allow(clippy::cast_possible_truncation)]
|
88 |
RNG.try_with(|rng| {
|
177 |
#[allow(clippy::cast_sign_loss)]
|
178 |
#[allow(clippy::cast_possible_truncation)]
|
179 |
#[inline]
|
1013 |
#[allow(clippy::cast_possible_truncation)]
|
1014 |
let fail_seed = std::cmp::max(3, time_now.as_nanos() as u32 % 128);
|
1181 |
#[allow(clippy::cast_possible_truncation)]
|
1182 |
let fail_seed = std::cmp::max(3, time_now.as_nanos() as u32 % 128);
|
1083 |
/// Returns `Err` if the image saving fails.
|
1084 |
#[allow(clippy::cast_possible_truncation)]
|
1085 |
pub fn save_to_vec(&self) -> Result<Vec<u8>> {
|
185 |
impl Display for W32Error {
|
186 |
#[allow(clippy::cast_possible_truncation)]
|
187 |
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
8 |
for b in data.as_ref() {
|
9 |
#[allow(clippy::cast_possible_truncation)]
|
10 |
let index = result as u8 ^ b;
|
42 |
(seed, obj_index).hash(&mut hasher);
|
43 |
#[allow(clippy::cast_possible_truncation)]
|
44 |
let id = (hasher.finish() & 0xffff) as i32;
|
349 |
impl SerializeIntoSlice for &str {
|
350 |
#[allow(clippy::cast_possible_truncation)]
|
351 |
fn write_into_slice(&self, buf: &mut [u8]) -> Result<usize, Error> {
|
458 |
/// - else: `n >= 16`
|
459 |
#[allow(clippy::cast_possible_truncation)]
|
460 |
pub fn serialize_array_start(n: usize, buf: &mut [u8]) -> Result<usize, Error> {
|
489 |
/// - else: `n >= 16`
|
490 |
#[allow(clippy::cast_possible_truncation)]
|
491 |
pub fn serialize_map_start(n: usize, buf: &mut [u8]) -> Result<usize, Error> {
|
39 |
#[allow(clippy::cast_sign_loss)]
|
40 |
#[allow(clippy::cast_possible_truncation)]
|
41 |
pub fn to_ext<'a>(&self, buf: &'a mut [u8]) -> Result<Ext<'a>, Error> {
|
78 |
#[allow(clippy::cast_sign_loss)]
|
79 |
#[allow(clippy::cast_possible_truncation)]
|
80 |
fn write_into_slice(&self, buf: &mut [u8]) -> Result<usize, Error> {
|
128 |
#[allow(clippy::cast_possible_truncation)]
|
129 |
fn try_from(ext: Ext<'a>) -> Result<Self, Self::Error> {
|
24 |
#[allow(clippy::cast_precision_loss)]
|
25 |
#[allow(clippy::cast_possible_truncation)]
|
26 |
#[allow(clippy::cast_possible_wrap)]
|
65 |
/// Pick a unit and suffix for the given size.
|
66 |
#[allow(clippy::cast_possible_truncation)]
|
67 |
#[allow(clippy::cast_possible_wrap)]
|
93 |
#[case(1000.0, None, None, "1.0 kB")]
|
94 |
#[allow(clippy::cast_possible_truncation)]
|
95 |
#[allow(clippy::cast_sign_loss)]
|
56 |
/// A vector of number of characters for each edge.
|
57 |
#[allow(clippy::cast_possible_truncation)]
|
58 |
#[allow(clippy::cast_sign_loss)]
|
157 |
#[allow(clippy::cast_precision_loss)]
|
158 |
#[allow(clippy::cast_possible_truncation)]
|
159 |
fn ratio_reduce(total: i32, ratios: &[i32], maximums: &[i32], values: Vec<i32>) -> Vec<i32> {
|
196 |
#[allow(clippy::cast_precision_loss)]
|
197 |
#[allow(clippy::cast_possible_truncation)]
|
198 |
fn ratio_distribute(total: i32, ratios: Vec<i32>, minimums: Option<Vec<i32>>) -> Vec<i32> {
|
200 |
#[allow(clippy::cast_sign_loss)]
|
201 |
#[allow(clippy::cast_possible_truncation)]
|
202 |
AudioContextLatencyCategory::Custom(latency) => {
|
316 |
pub fn set_last_received(&self, d: Duration) {
|
317 |
#[allow(clippy::cast_possible_truncation)]
|
318 |
self.last_received
|
322 |
pub fn set_last_sent(&self, d: Duration) {
|
323 |
#[allow(clippy::cast_possible_truncation)]
|
324 |
self.last_sent.store(d.as_nanos() as u64, Ordering::SeqCst);
|
290 |
pub(crate) fn set_last_received(&self, d: Duration) {
|
291 |
#[allow(clippy::cast_possible_truncation)]
|
292 |
self.last_received
|
296 |
pub(crate) fn set_last_sent(&self, d: Duration) {
|
297 |
#[allow(clippy::cast_possible_truncation)]
|
298 |
self.last_sent.store(d.as_nanos() as u64, Ordering::SeqCst);
|
166 |
#[allow(clippy::cast_possible_truncation)]
|
167 |
let sine_value = (dist_value_times_scale / length_scale)
|
208 |
// cast is safe since we shift by 26, which leaves 6 bits
|
209 |
#[allow(clippy::cast_possible_truncation)]
|
210 |
let must = (self.0 >> 26) as u8;
|
248 |
// cast is safe since we shift by 26 and mask by 0x1F, which leaves 5 bits
|
249 |
#[allow(clippy::cast_possible_truncation)]
|
250 |
Letter(((self.0 >> 26) & 0x1F) as _)
|
185 |
// cast is safe since we shift by 26, which leaves 6 bits
|
186 |
#[allow(clippy::cast_possible_truncation)]
|
187 |
let must = (self.0 >> 26) as u8;
|
219 |
// cast is safe since we shift by 26 and mask by 0x1F, which leaves 5 bits
|
220 |
#[allow(clippy::cast_possible_truncation)]
|
221 |
Letter(((self.0 >> 26) & 0x1F) as _)
|
834 |
#[allow(clippy::cast_possible_truncation)]
|
835 |
util::float_to_int(amount).unwrap_or(u32::MAX)
|
216 |
#[allow(clippy::cast_possible_truncation)]
|
217 |
let word_index = (hash >> (index as u32 * shift)) as usize & (2_usize.pow(shift) - 1);
|
237 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
238 |
pub(crate) fn float_to_int(float: f32) -> Result<u32, String> {
|
201 |
// the game rounds to even
|
202 |
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation, clippy::float_cmp)]
|
203 |
if value % 1. == 0.5 && value as u8 % 2 == 0 {
|
267 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
268 |
weapons.sort_unstable_by_key(|&weapon| (weapon.damage_per_energy(self.settings.difficulty) * 10.0) as u16);
|
285 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
286 |
weapons.sort_unstable_by_key(|&weapon| (weapon.damage_per_energy(self.settings.difficulty) * 10.0) as u16);
|
297 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
298 |
weapons.sort_unstable_by_key(|&weapon| (weapon.damage_per_energy(self.settings.difficulty) * 10.0) as u16);
|
54 |
#[allow(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
|
55 |
fn calc_percent(current: u64, max: u64) -> i32 {
|
41 |
.expect("Clock may have gone backwards");
|
42 |
#[allow(clippy::cast_possible_truncation)]
|
43 |
self.generate(unix_ts.as_secs() as u32)
|
6 |
// https://github.com/rs/xid/blob/efa678f304ab65d6d57eedcb086798381ae22206/id.go#L159
|
7 |
#[allow(clippy::cast_possible_truncation)]
|
8 |
pub fn get() -> u16 {
|
179 |
/// Inserts `value` into the map with `key`, returning the existing value in the slot if present
|
180 |
#[allow(clippy::cast_possible_truncation, clippy::missing_panics_doc)]
|
181 |
pub fn insert(&mut self, key: K, value: V) -> Option<V> {
|
228 |
/// Returns a mutable reference to the value with the given key, inserting `value` in that slot if necessary
|
229 |
#[allow(clippy::cast_possible_truncation, clippy::missing_panics_doc)]
|
230 |
pub fn get_or_insert_mut(&mut self, key: K, value: V) -> &mut V {
|
277 |
/// Returns a mutable reference to the value with the given key, inserting the value produced by `value`
|
278 |
#[allow(clippy::cast_possible_truncation, clippy::missing_panics_doc)]
|
279 |
pub fn get_or_insert_with_mut<F: FnOnce(&K) -> V>(&mut self, key: K, value: F) -> &mut V {
|
327 |
/// Gets an immutable reference to the value given by `key`, if present, otherwise returns `None`.
|
328 |
#[allow(clippy::cast_possible_truncation)]
|
329 |
pub fn get<Q: ?Sized + Hash + Eq>(&self, key: &Q) -> Option<&V>
|
354 |
/// Gets a mutable reference to the value given by `key`, if present, otherwise returns `None`.
|
355 |
#[allow(clippy::cast_possible_truncation)]
|
356 |
pub fn get_mut<Q: ?Sized + Hash + Eq>(&mut self, key: &Q) -> Option<&mut V>
|
165 |
#[test]
|
166 |
#[allow(clippy::cast_possible_truncation)] //reason = "`i as u8` doesn't truncate"
|
167 |
fn hex_cmp() {
|
291 |
// truncate unless we manually give the cursor a ridiculous position.
|
292 |
#[allow(clippy::cast_possible_truncation)]
|
293 |
let offset = self.prefix.position() as usize;
|
118 |
// possibly exceed usize::MAX.
|
119 |
#[allow(clippy::cast_possible_truncation)]
|
120 |
let size = size as usize;
|
600 |
/// Typed version of [`Array::keys`].
|
601 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
602 |
pub fn typed_keys(&self) -> impl Iterator<Item = u32> {
|
170 |
#[inline]
|
171 |
#[allow(clippy::cast_possible_truncation)]
|
172 |
#[allow(clippy::cast_sign_loss)]
|
212 |
impl From<f32> for Action {
|
213 |
#[allow(clippy::cast_possible_truncation)]
|
214 |
fn from(v: f32) -> Self {
|
93 |
#[allow(clippy::cast_possible_truncation)]
|
94 |
let length = (values_length as u8, signals_length as u8);
|
188 |
#[allow(clippy::cast_possible_truncation)]
|
189 |
fn nth(&mut self, n: usize) -> Option<Self::Item> {
|
57 |
#[allow(clippy::cast_possible_truncation)]
|
58 |
Ok(Self {
|
96 |
#[allow(clippy::cast_possible_truncation)]
|
97 |
if value >= self.value {
|
210 |
#[allow(clippy::cast_possible_truncation)]
|
211 |
if value <= self.value {
|
69 |
fn new(length: Self::Params, value: &Self::Input) -> Result<Self, Error> {
|
70 |
#[allow(clippy::cast_possible_truncation)]
|
71 |
#[allow(clippy::cast_sign_loss)]
|
124 |
#[allow(clippy::cast_possible_truncation)]
|
125 |
#[allow(clippy::cast_sign_loss)]
|
332 |
#[inline]
|
333 |
#[allow(clippy::cast_possible_truncation)]
|
334 |
#[allow(clippy::cast_sign_loss)]
|
476 |
) -> Result<KeyEvent> {
|
477 |
#[allow(clippy::cast_possible_truncation)]
|
478 |
match digit {
|
489 |
let key = rdr.next_key(true)?;
|
490 |
#[allow(clippy::cast_possible_truncation)]
|
491 |
match key {
|
659 |
#[allow(clippy::cast_possible_truncation)]
|
660 |
fn vi_arg_digit<R: RawReader>(
|
143 |
#[allow(clippy::cast_possible_truncation)]
|
144 |
fn _call(&mut self, req: &JSONRpcRequest) -> Result<Value, Error> {
|
222 |
}
|
223 |
#[allow(clippy::cast_possible_truncation)]
|
224 |
async fn _call(&mut self, req: &JSONRpcRequest) -> Result<Value, Error> {
|
1262 |
/// Will return Err on invalid property or value
|
1263 |
#[allow(clippy::cast_possible_truncation)]
|
1264 |
pub fn server_set(&mut self, name: &str, value: Value) -> Result<(), Error> {
|
1384 |
/// Will panic on internal errors
|
1385 |
#[allow(clippy::cast_possible_truncation)]
|
1386 |
pub fn key_explain(&mut self, key: &str) -> Result<KeyExplained, Error> {
|
50 |
#[allow(clippy::cast_precision_loss)]
|
51 |
#[allow(clippy::cast_possible_truncation)]
|
52 |
#[allow(clippy::cast_sign_loss)]
|
638 |
#[allow(clippy::cast_possible_truncation)]
|
639 |
async fn save_dump(
|
89 |
assert!(zbase32.len() as u64 * 5 >= bits, "zbase32 slice too short");
|
90 |
#[allow(clippy::cast_possible_truncation)]
|
91 |
let capacity = if bits % 8 == 0 {
|
108 |
if buffer_size >= 8 {
|
109 |
#[allow(clippy::cast_possible_truncation)]
|
110 |
let byte = (buffer >> (buffer_size - 8)) as u8;
|
116 |
if bits_remaining > 0 {
|
117 |
#[allow(clippy::cast_possible_truncation)]
|
118 |
let trim_right = buffer_size - bits_remaining as u8;
|
120 |
buffer_size -= trim_right;
|
121 |
#[allow(clippy::cast_possible_truncation)]
|
122 |
let byte = (buffer << (8_u8 - buffer_size)) as u8;
|
199 |
assert!(data.len() as u64 * 8 >= bits, "slice too short");
|
200 |
#[allow(clippy::cast_possible_truncation)]
|
201 |
let capacity = if bits % 5 == 0 {
|
96 |
// The mask prevents truncations
|
97 |
#[allow(clippy::cast_possible_truncation)]
|
98 |
let mut n: i16 = (scalar.limb(0) & mask) as i16;
|
13 |
// Conversions f32 -> usize are safe here.
|
14 |
#[allow(clippy::cast_possible_truncation)]
|
15 |
// We have no negative numbers here (not even .log10() < 0).
|
121 |
// We want truncation here
|
122 |
#[allow(clippy::cast_possible_truncation)]
|
123 |
(ret as u64, (ret >> 64) as u64)
|
175 |
// We want truncation here
|
176 |
#[allow(clippy::cast_possible_truncation)]
|
177 |
(ret as u64, (ret >> 64) as u64)
|
100 |
fn arb_matrix_sized(size: usize, stretch: usize) -> impl Strategy<Value = Vec<u32>> {
|
101 |
#[allow(clippy::cast_possible_truncation)]
|
102 |
Just((0..size * size * stretch).map(|i| i as u32).collect())
|
744 |
// FRI layout values are small.
|
745 |
#[allow(clippy::cast_possible_truncation)]
|
746 |
let coset_size = 2_usize.pow(n_reductions as u32);
|
247 |
// TODO: Clean up
|
248 |
#[allow(clippy::cast_possible_truncation)]
|
249 |
fn get_indices(num: usize, bits: u32, proof: &mut VerifierChannel) -> Vec<usize> {
|
424 |
// TODO: Clean up
|
425 |
#[allow(clippy::cast_possible_truncation)]
|
426 |
fn get_indices(num: usize, bits: u32, proof: &mut VerifierChannel) -> Vec<usize> {
|
5 |
// We want truncation here
|
6 |
#[allow(clippy::cast_possible_truncation)]
|
7 |
(ret as u64, (ret >> 64) as u64)
|
14 |
// We want truncation here
|
15 |
#[allow(clippy::cast_possible_truncation)]
|
16 |
(ret as u64, (ret >> 127) as u64)
|
24 |
// We want truncation here
|
25 |
#[allow(clippy::cast_possible_truncation)]
|
26 |
(ret as u64, (ret >> 64) as u64)
|
34 |
// We want truncation here
|
35 |
#[allow(clippy::cast_possible_truncation)]
|
36 |
(ret as u64, 0_u64.wrapping_sub((ret >> 64) as u64))
|
47 |
// We want truncation here
|
48 |
#[allow(clippy::cast_possible_truncation)]
|
49 |
(q as u64, r as u64)
|
32 |
// There should not be any truncation.
|
33 |
#[allow(clippy::cast_possible_truncation)]
|
34 |
(q as u64, r as u64)
|
25 |
// We want truncation here
|
26 |
#[allow(clippy::cast_possible_truncation)]
|
27 |
for i in (0..32).rev() {
|
84 |
// We want truncation here
|
85 |
#[allow(clippy::cast_possible_truncation)]
|
86 |
Self::from_limbs([n as u64, (n >> 64) as u64, 0, 0])
|
122 |
// We want truncation here
|
123 |
#[allow(clippy::cast_possible_truncation)]
|
124 |
fn from(n: i128) -> Self {
|
74 |
// Std `rotate_left` uses `u32` instead of `usize`
|
75 |
#[allow(clippy::cast_possible_truncation)]
|
76 |
<Self as PrimInt>::rotate_left(*self, n as u32)
|
42 |
let fixed = (value.as_f64() * 256.0).round();
|
43 |
#[allow(clippy::cast_possible_truncation)]
|
44 |
let value = fixed as i16;
|
6 |
clippy::cast_sign_loss,
|
7 |
clippy::cast_possible_truncation
|
8 |
)]
|
266 |
#[allow(
|
267 |
clippy::cast_possible_truncation,
|
268 |
clippy::cast_sign_loss,
|
309 |
clippy::many_single_char_names,
|
310 |
clippy::cast_possible_truncation,
|
311 |
clippy::cast_sign_loss
|
376 |
#[inline(always)]
|
377 |
#[allow(clippy::cast_possible_truncation)]
|
378 |
const fn peek_bits<const LOOKAHEAD: u8>(&self) -> i32
|
392 |
#[inline(always)]
|
393 |
#[allow(clippy::cast_possible_truncation)]
|
394 |
fn get_bits(&mut self, n_bits: u8) -> i32
|
5 |
#[inline]
|
6 |
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss, dead_code)]
|
7 |
fn clamp(a: i16) -> u8
|
589 |
#[deprecated(since = "0.2.0", note = "Use new_with_options to set options")]
|
590 |
#[allow(clippy::cast_possible_truncation)]
|
591 |
pub fn set_num_threads(&mut self, threads: usize) -> Result<(), DecodeErrors>
|
123 |
///**B.2.4.1 Quantization table-specification syntax**
|
124 |
#[allow(clippy::cast_possible_truncation)]
|
125 |
pub(crate) fn parse_dqt<R>(decoder: &mut Decoder, buf: &mut R) -> Result<(), DecodeErrors>
|
29 |
// lengths and the latter for in-memory buffer sizes.
|
30 |
#![allow(clippy::cast_possible_truncation)]
|
29 |
clippy::module_name_repetitions,
|
30 |
clippy::cast_possible_truncation,
|
31 |
clippy::cast_precision_loss,
|
11 |
#![allow(clippy::integer_division)]
|
12 |
#![allow(clippy::cast_possible_truncation)]
|
26 |
#![allow(
|
27 |
clippy::cast_possible_truncation,
|
28 |
clippy::cast_possible_wrap,
|
12 |
clippy::blanket_clippy_restriction_lints,
|
13 |
clippy::cast_possible_truncation,
|
14 |
clippy::cast_possible_wrap,
|
3 |
#![allow(clippy::cast_possible_wrap)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
109 |
// integer and float ser/de requires these sorts of casts
|
110 |
cast_possible_truncation,
|
111 |
cast_possible_wrap,
|
33 |
#![allow(
|
34 |
clippy::cast_possible_truncation,
|
35 |
clippy::checked_conversions,
|
325 |
// integer and float ser/de requires these sorts of casts
|
326 |
clippy::cast_possible_truncation,
|
327 |
clippy::cast_possible_wrap,
|
14 |
clippy::cargo_common_metadata,
|
15 |
clippy::cast_possible_truncation,
|
16 |
clippy::cast_precision_loss,
|
30 |
clippy::missing_errors_doc,
|
31 |
clippy::cast_possible_truncation,
|
32 |
clippy::unseparated_literal_suffix
|
132 |
clippy::missing_errors_doc,
|
133 |
clippy::cast_possible_truncation,
|
134 |
clippy::unseparated_literal_suffix
|
12 |
clippy::cast_sign_loss,
|
13 |
clippy::cast_possible_truncation,
|
14 |
// It's a ******* Rc
|
3 |
#![warn(clippy::all, clippy::pedantic)]
|
4 |
#![allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
5 |
use clap::Parser;
|
3 |
#![warn(clippy::all, clippy::pedantic)]
|
4 |
#![allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
5 |
mod converter;
|
166 |
#![allow(clippy::cast_lossless)]
|
167 |
#![allow(clippy::cast_possible_truncation)]
|
168 |
#![allow(clippy::implicit_hasher)]
|
3 |
#![warn(clippy::pedantic)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::cast_possible_wrap)]
|
3 |
#![warn(clippy::pedantic)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::cast_possible_wrap)]
|
12 |
#![warn(clippy::pedantic)]
|
13 |
#![allow(clippy::cast_possible_truncation)]
|
14 |
#![allow(clippy::cast_possible_wrap)]
|
3 |
#![allow(clippy::missing_panics_doc)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::cast_sign_loss)]
|
18 |
)]
|
19 |
#![allow(clippy::similar_names, clippy::cast_possible_truncation)]
|
13 |
clippy::blanket_clippy_restriction_lints,
|
14 |
clippy::cast_possible_truncation,
|
15 |
clippy::cast_possible_wrap,
|
39 |
clippy::cast_sign_loss,
|
40 |
clippy::cast_possible_truncation,
|
41 |
clippy::cast_lossless,
|
13 |
#![deny(clippy::pedantic)]
|
14 |
#![allow(clippy::cast_possible_truncation)]
|
46 |
#![allow(
|
47 |
clippy::cast_possible_truncation,
|
48 |
clippy::cast_possible_wrap,
|
13 |
clippy::cast_sign_loss,
|
14 |
clippy::cast_possible_truncation,
|
15 |
clippy::cast_lossless,
|
15 |
clippy::cast_precision_loss,
|
16 |
clippy::cast_possible_truncation,
|
17 |
clippy::multiple_crate_versions,
|
15 |
clippy::cast_precision_loss,
|
16 |
clippy::cast_possible_truncation,
|
17 |
clippy::multiple_crate_versions
|
18 |
#![allow(clippy::cast_precision_loss)]
|
19 |
#![allow(clippy::cast_possible_truncation)]
|
20 |
#![allow(clippy::multiple_crate_versions)] // this is a dependency problem
|
14 |
clippy::cast_lossless,
|
15 |
clippy::cast_possible_truncation,
|
16 |
clippy::module_name_repetitions,
|
1 |
#![allow(clippy::cast_possible_truncation)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
14 |
dead_code,
|
15 |
clippy::cast_possible_truncation,
|
16 |
clippy::use_self,
|
44 |
clippy::module_name_repetitions,
|
45 |
clippy::cast_possible_truncation,
|
46 |
clippy::cast_sign_loss,
|
55 |
clippy::module_name_repetitions,
|
56 |
clippy::cast_possible_truncation,
|
57 |
clippy::cast_sign_loss,
|
55 |
clippy::module_name_repetitions,
|
56 |
clippy::cast_possible_truncation,
|
57 |
clippy::cast_sign_loss,
|
52 |
clippy::module_name_repetitions,
|
53 |
clippy::cast_possible_truncation,
|
54 |
clippy::cast_sign_loss,
|
2 |
#![warn(clippy::pedantic)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
4 |
#![warn(clippy::cargo)]
|
17 |
#![allow(clippy::cast_precision_loss)] // Annoying
|
18 |
#![allow(clippy::cast_possible_truncation)] // Annoying
|
19 |
#![allow(clippy::cognitive_complexity)] // This is dumb
|
15 |
// Annoying regular clippy warnings
|
16 |
#![allow(clippy::cast_possible_truncation)] // Annoying
|
17 |
#![allow(clippy::cast_precision_loss)] // Annoying
|
57 |
#![allow(clippy::cast_precision_loss)] // Annoying
|
58 |
#![allow(clippy::cast_possible_truncation)] // Annoying
|
59 |
#![allow(clippy::cognitive_complexity)] // This is dumb
|
9 |
clippy::missing_errors_doc,
|
10 |
clippy::cast_possible_truncation
|
11 |
)]
|
7 |
clippy::cast_precision_loss,
|
8 |
clippy::cast_possible_truncation
|
9 |
)]
|
11 |
clippy::cast_sign_loss,
|
12 |
clippy::cast_possible_truncation
|
13 |
)]
|
18 |
#![allow(
|
19 |
clippy::cast_possible_truncation,
|
20 |
clippy::cast_sign_loss,
|
13 |
#![allow(
|
14 |
clippy::cast_possible_truncation,
|
15 |
clippy::cast_sign_loss,
|
25 |
#![allow(clippy::case_sensitive_file_extension_comparisons)]
|
26 |
#![allow(clippy::cast_possible_truncation)]
|
27 |
#![allow(clippy::cast_possible_wrap)]
|
18 |
#![allow(
|
19 |
clippy::cast_possible_truncation,
|
20 |
clippy::cast_sign_loss,
|
13 |
#![allow(
|
14 |
clippy::cast_possible_truncation,
|
15 |
clippy::cast_sign_loss,
|
4 |
clippy::borrowed_box,
|
5 |
clippy::cast_possible_truncation,
|
6 |
clippy::cast_precision_loss,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_precision_loss,
|
13 |
clippy::blanket_clippy_restriction_lints,
|
14 |
clippy::cast_possible_truncation,
|
15 |
clippy::cast_possible_wrap,
|
236 |
pub fn evaluate(&mut self, frame: &Frame) -> Vec<Match> {
|
237 |
#![allow(clippy::cast_possible_truncation)]
|
238 |
let mut count = 0;
|
48 |
clippy::cast_possible_wrap,
|
49 |
clippy::cast_possible_truncation,
|
50 |
clippy::copy_iterator
|
6 |
#![allow(clippy::cast_possible_truncation)]
|
276 |
clippy::cast_lossless,
|
277 |
clippy::cast_possible_truncation,
|
278 |
clippy::cast_precision_loss,
|
1 |
#![allow(clippy::cast_possible_truncation)]
|
14 |
#![allow(
|
15 |
clippy::cast_possible_truncation,
|
16 |
clippy::cast_possible_wrap,
|
20 |
clippy::type_complexity,
|
21 |
clippy::cast_possible_truncation,
|
22 |
clippy::derive_hash_xor_eq,
|
44 |
clippy::cast_possible_wrap,
|
45 |
clippy::cast_possible_truncation,
|
46 |
clippy::cast_precision_loss,
|
53 |
cast_possible_wrap,
|
54 |
cast_possible_truncation,
|
55 |
cast_precision_loss,
|
5 |
#![warn(clippy::unimplemented)]
|
6 |
#![allow(clippy::cast_possible_truncation)]
|
7 |
#![allow(clippy::module_name_repetitions)]
|
61 |
#![cfg_attr(feature = "cargo-clippy", warn(warnings, clippy_pedantic))]
|
62 |
#![cfg_attr(feature = "cargo-clippy", allow(missing_docs_in_private_items, use_debug, cast_possible_truncation))]
|
25 |
clippy::doc_markdown,
|
26 |
clippy::cast_possible_truncation,
|
27 |
clippy::cast_sign_loss,
|
13 |
#![deny(clippy::pedantic)]
|
14 |
#![allow(clippy::cast_possible_truncation)]
|
13 |
#![deny(clippy::pedantic)]
|
14 |
#![allow(clippy::cast_possible_truncation)]
|
13 |
#![deny(clippy::pedantic)]
|
14 |
#![allow(clippy::cast_possible_truncation)]
|
15 |
#![allow(clippy::identity_op)]
|
9 |
#![allow(
|
10 |
clippy::cast_possible_truncation,
|
11 |
clippy::module_name_repetitions,
|
5 |
clippy::must_use_candidate,
|
6 |
clippy::cast_possible_truncation,
|
7 |
clippy::similar_names,
|
17 |
clippy::must_use_candidate,
|
18 |
clippy::cast_possible_truncation,
|
19 |
clippy::similar_names,
|
7 |
clippy::cast_sign_loss,
|
8 |
clippy::cast_possible_truncation,
|
9 |
clippy::similar_names
|
15 |
clippy::cast_sign_loss, // TODO: Fix these. See issue #1
|
16 |
clippy::cast_possible_truncation, // TODO: Fix these. See issue #1
|
17 |
clippy::cast_precision_loss, // TODO: Fix these. See issue #1
|
70 |
clippy::cast_lossless,
|
71 |
clippy::cast_possible_truncation,
|
72 |
clippy::doc_markdown,
|
3 |
clippy::assertions_on_result_states,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_possible_wrap,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::doc_markdown,
|
111 |
match (op_1, op_2, op_3, op_4) {
|
112 |
#![allow(clippy::match_same_arms, clippy::cast_possible_truncation)]
|
113 |
// from chip8run:
|
30 |
#![allow(
|
31 |
clippy::cast_possible_truncation,
|
32 |
clippy::cast_possible_wrap,
|
13 |
clippy::blanket_clippy_restriction_lints,
|
14 |
clippy::cast_possible_truncation,
|
15 |
clippy::cast_possible_wrap,
|
31 |
#![allow(
|
32 |
clippy::cast_possible_truncation,
|
33 |
clippy::cast_sign_loss,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_possible_wrap,
|
53 |
clippy::cast_lossless,
|
54 |
clippy::cast_possible_truncation,
|
55 |
clippy::cast_possible_wrap,
|
35 |
#![allow(
|
36 |
clippy::cast_possible_truncation,
|
37 |
clippy::cast_precision_loss,
|
50 |
incomplete_features,
|
51 |
clippy::cast_possible_truncation,
|
52 |
clippy::cast_possible_wrap,
|
6 |
#![warn(clippy::pedantic)]
|
7 |
#![allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::similar_names)]
|
48 |
#![allow(
|
49 |
clippy::cast_possible_truncation,
|
50 |
clippy::doc_markdown,
|
59 |
#![allow(
|
60 |
clippy::cast_possible_truncation,
|
61 |
clippy::doc_markdown,
|
133 |
#![warn(clippy::pedantic)]
|
134 |
#![allow(clippy::cast_possible_truncation, clippy::doc_markdown, clippy::wildcard_imports)]
|
135 |
#![no_std]
|
23 |
#![allow(
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::missing_errors_doc,
|
1 |
#![allow(clippy::cast_possible_wrap, clippy::cast_possible_truncation)]
|
37 |
clippy::cast_lossless,
|
38 |
clippy::cast_possible_truncation,
|
39 |
clippy::cast_sign_loss,
|
85 |
clippy::cast_lossless,
|
86 |
clippy::cast_possible_truncation,
|
87 |
clippy::cast_precision_loss,
|
59 |
// Next `cast_*` lints don't give alternatives.
|
60 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
61 |
// Next lints produce too much noise/false positives.
|
70 |
#![allow(
|
71 |
clippy::cast_possible_truncation,
|
72 |
clippy::excessive_precision,
|
4 |
clippy::module_name_repetitions,
|
5 |
clippy::cast_possible_truncation,
|
6 |
clippy::cast_lossless,
|
41 |
// (Hopefully) always manual checked
|
42 |
clippy::cast_possible_truncation,
|
43 |
// Impossible to fulfil in crypto code
|
86 |
// Next `cast_*` lints don't give alternatives.
|
87 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
88 |
// Next lints produce too much noise/false positives.
|
122 |
// Next `cast_*` lints don't give alternatives.
|
123 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
124 |
// Next lints produce too much noise/false positives.
|
31 |
// Next `cast_*` lints don't give alternatives.
|
32 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
33 |
// Next lints produce too much noise/false positives.
|
40 |
// Next `cast_*` lints don't give alternatives.
|
41 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
42 |
// Next lints produce too much noise/false positives.
|
70 |
// Next `cast_*` lints don't give alternatives.
|
71 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
72 |
// Next lints produce too much noise/false positives.
|
46 |
// Next `cast_*` lints don't give alternatives.
|
47 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
48 |
// Next lints produce too much noise/false positives.
|
151 |
// Next `cast_*` lints don't give alternatives.
|
152 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
153 |
// Next lints produce too much noise/false positives.
|
44 |
// Next `cast_*` lints don't give alternatives.
|
45 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
46 |
// Next lints produce too much noise/false positives.
|
46 |
// Next `cast_*` lints don't give alternatives.
|
47 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
48 |
// Next lints produce too much noise/false positives.
|
45 |
// Next `cast_*` lints don't give alternatives.
|
46 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
47 |
// Next lints produce too much noise/false positives.
|
311 |
// Next `cast_*` lints don't give alternatives.
|
312 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
313 |
// Next lints produce too much noise/false positives.
|
137 |
// Next `cast_*` lints don't give alternatives.
|
138 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
139 |
// Next lints produce too much noise/false positives.
|
84 |
// Next `cast_*` lints don't give alternatives.
|
85 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
86 |
// Next lints produce too much noise/false positives.
|
103 |
// Next `cast_*` lints don't give alternatives.
|
104 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
105 |
// Next lints produce too much noise/false positives.
|
107 |
// Next `cast_*` lints don't give alternatives.
|
108 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
109 |
// Next lints produce too much noise/false positives.
|
35 |
#![allow(
|
36 |
clippy::cast_possible_truncation,
|
37 |
clippy::cast_possible_wrap,
|
18 |
)]
|
19 |
#![allow(clippy::cast_possible_truncation)]
|
2 |
#![allow(clippy::use_self)] // clippy false-positive
|
3 |
#![allow(clippy::cast_possible_truncation)] // we'll be okay with this one
|
4 |
use std::any::Any;
|
76 |
#![warn(clippy::cargo)]
|
77 |
#![allow(clippy::cast_possible_truncation)] // All our casts are in a range where this doesn't matter.
|
78 |
#![allow(clippy::cast_precision_loss)]
|
1 |
#![warn(clippy::all, clippy::pedantic)]
|
2 |
#![allow(clippy::similar_names, clippy::cast_possible_truncation)]
|
3 |
use crate::{instance::Instance, report::IlpReductionReport};
|
23 |
clippy::use_self,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
18 |
clippy::use_self,
|
19 |
clippy::cast_possible_truncation,
|
20 |
clippy::cast_possible_wrap,
|
1 |
#![allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
3 |
clippy::cast_sign_loss,
|
4 |
clippy::cast_possible_truncation
|
5 |
)]
|
39 |
#![allow(clippy::cast_possible_wrap)]
|
40 |
#![allow(clippy::cast_possible_truncation)]
|
41 |
#![allow(clippy::similar_names)]
|
1 |
#![allow(clippy::cast_possible_truncation, clippy::match_single_binding)]
|
2 |
#![allow(
|
3 |
clippy::cast_possible_truncation,
|
4 |
clippy::too_many_lines,
|
222 |
#![allow(
|
223 |
clippy::cast_possible_truncation,
|
224 |
clippy::manual_strip,
|
76 |
clippy::as_conversions,
|
77 |
clippy::cast_possible_truncation,
|
78 |
clippy::redundant_closure_for_method_calls,
|
76 |
clippy::as_conversions,
|
77 |
clippy::cast_possible_truncation,
|
78 |
clippy::new_without_default
|
4 |
clippy::must_use_candidate,
|
5 |
clippy::cast_possible_truncation,
|
6 |
clippy::cast_sign_loss,
|
6 |
clippy::too_many_lines,
|
7 |
clippy::cast_possible_truncation,
|
8 |
clippy::cast_sign_loss,
|
31 |
{
|
32 |
#![allow(clippy::as_conversions, clippy::cast_possible_truncation)]
|
19 |
{
|
20 |
#![allow(clippy::as_conversions, clippy::cast_possible_truncation)]
|
21 |
// This `as` conversion cast is ok because we want truncation.
|
56 |
clippy::too_many_lines,
|
57 |
clippy::cast_possible_truncation,
|
58 |
clippy::single_match_else,
|
56 |
clippy::too_many_lines,
|
57 |
clippy::cast_possible_truncation,
|
58 |
clippy::single_match_else,
|
3 |
#![warn(clippy::pedantic)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::cast_possible_wrap)]
|
3 |
#![allow(
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_sign_loss,
|
100 |
clippy::module_name_repetitions,
|
101 |
clippy::cast_possible_truncation,
|
102 |
clippy::non_ascii_literal
|
5 |
clippy::cast_lossless,
|
6 |
clippy::cast_possible_truncation,
|
7 |
clippy::cast_possible_wrap,
|
55 |
#![allow(clippy::cast_lossless)]
|
56 |
#![allow(clippy::cast_possible_truncation)]
|
57 |
#![allow(clippy::wildcard_imports)]
|
74 |
clippy::wildcard_imports, // for autogen protocol.rs
|
75 |
clippy::cast_possible_truncation, // for types.rs:189 & 190
|
76 |
clippy::cast_sign_loss, // for tab/element/mod.rs:492 & 493
|
37 |
clippy::cast_possible_wrap,
|
38 |
clippy::cast_possible_truncation,
|
39 |
clippy::cast_sign_loss,
|
3 |
#![allow(
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_sign_loss,
|
39 |
clippy::cast_possible_wrap,
|
40 |
clippy::cast_possible_truncation,
|
41 |
clippy::cast_sign_loss,
|
22 |
clippy::cast_sign_loss,
|
23 |
clippy::cast_possible_truncation,
|
24 |
clippy::cast_possible_wrap,
|
38 |
clippy::suboptimal_flops,
|
39 |
clippy::cast_possible_truncation,
|
40 |
clippy::cast_sign_loss,
|
40 |
clippy::suboptimal_flops,
|
41 |
clippy::cast_possible_truncation,
|
42 |
clippy::cast_sign_loss,
|
35 |
clippy::suboptimal_flops,
|
36 |
clippy::cast_possible_truncation,
|
37 |
clippy::cast_sign_loss,
|
4 |
clippy::enum_glob_use,
|
5 |
clippy::cast_possible_truncation
|
6 |
)]
|
46 |
clippy::cast_sign_loss,
|
47 |
clippy::cast_possible_truncation
|
48 |
)]
|
14 |
clippy::cast_precision_loss,
|
15 |
clippy::cast_possible_truncation
|
16 |
)]
|
4 |
#![warn(clippy::undocumented_unsafe_blocks)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(unknown_lints)]
|
89 |
clippy::cast_lossless,
|
90 |
clippy::cast_possible_truncation,
|
91 |
clippy::cast_possible_wrap,
|
5 |
clippy::missing_docs_in_private_items,
|
6 |
clippy::cast_possible_truncation,
|
7 |
clippy::cast_possible_wrap,
|
36 |
clippy::cast_lossless,
|
37 |
clippy::cast_possible_truncation,
|
38 |
clippy::must_use_candidate,
|
36 |
clippy::cast_lossless,
|
37 |
clippy::cast_possible_truncation,
|
38 |
clippy::must_use_candidate,
|
5 |
// This can't be easily fixed, due to a limitation of Rust's standard library.
|
6 |
#![allow(clippy::cast_possible_truncation)]
|
183 |
// Accept the 32-bit limit on item contents for files on platforms with 32-bit pointers.
|
184 |
#![allow(clippy::cast_possible_truncation)]
|
185 |
let mut result = vec![0_u8; item.location.data_size as usize];
|
214 |
// Accept the 32-bit limit on item contents for files on platforms with 32-bit pointers.
|
215 |
#![allow(clippy::cast_possible_truncation)]
|
216 |
let mut result = vec![0_u8; item.location.data_size as usize];
|
17 |
clippy::module_name_repetitions,
|
18 |
clippy::cast_possible_truncation,
|
19 |
clippy::cast_precision_loss,
|
16 |
clippy::module_name_repetitions,
|
17 |
clippy::cast_possible_truncation,
|
18 |
clippy::cast_precision_loss,
|
17 |
clippy::module_name_repetitions,
|
18 |
clippy::cast_possible_truncation,
|
19 |
clippy::cast_precision_loss,
|
23 |
clippy::many_single_char_names,
|
24 |
clippy::cast_possible_truncation
|
25 |
)]
|
10 |
clippy::cast_precision_loss,
|
11 |
clippy::cast_possible_truncation,
|
12 |
clippy::cast_possible_wrap,
|
53 |
#![allow(
|
54 |
clippy::cast_possible_truncation,
|
55 |
clippy::cast_sign_loss,
|
11 |
#![allow(
|
12 |
clippy::cast_possible_truncation,
|
13 |
clippy::cast_sign_loss,
|
243 |
#![allow(
|
244 |
clippy::cast_possible_truncation,
|
245 |
clippy::cast_sign_loss,
|
66 |
#![allow(
|
67 |
clippy::cast_possible_truncation,
|
68 |
clippy::cast_sign_loss,
|
21 |
clippy::missing_errors_doc,
|
22 |
clippy::cast_possible_truncation,
|
23 |
clippy::used_underscore_binding,
|
9 |
clippy::missing_errors_doc,
|
10 |
clippy::cast_possible_truncation,
|
11 |
clippy::used_underscore_binding,
|
10 |
clippy::missing_errors_doc,
|
11 |
clippy::cast_possible_truncation,
|
12 |
clippy::used_underscore_binding,
|
14 |
clippy::missing_errors_doc,
|
15 |
clippy::cast_possible_truncation,
|
16 |
clippy::used_underscore_binding,
|
9 |
clippy::missing_errors_doc,
|
10 |
clippy::cast_possible_truncation,
|
11 |
clippy::used_underscore_binding,
|
11 |
clippy::missing_errors_doc,
|
12 |
clippy::cast_possible_truncation,
|
13 |
clippy::used_underscore_binding,
|
16 |
// Temporary, will remove
|
17 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
clippy::cast_sign_loss,
|
6 |
clippy::cast_possible_truncation,
|
7 |
clippy::module_name_repetitions
|
1 |
#![allow(
|
2 |
clippy::cast_possible_truncation, // https://github.com/rust-lang/rust-clippy/issues/7486
|
3 |
clippy::needless_pass_by_value,
|
120 |
clippy::cast_possible_wrap,
|
121 |
clippy::cast_possible_truncation,
|
122 |
clippy::module_name_repetitions,
|
8 |
clippy::missing_panics_doc,
|
9 |
clippy::cast_possible_truncation,
|
10 |
clippy::many_single_char_names
|
16 |
clippy::cast_sign_loss,
|
17 |
clippy::cast_possible_truncation
|
18 |
)]
|
2 |
#![allow(
|
3 |
clippy::cast_possible_truncation,
|
4 |
clippy::cast_sign_loss,
|
10 |
clippy::cast_sign_loss,
|
11 |
clippy::cast_possible_truncation,
|
12 |
clippy::trivially_copy_pass_by_ref
|
7 |
clippy::cast_sign_loss,
|
8 |
clippy::cast_possible_truncation,
|
9 |
clippy::trivially_copy_pass_by_ref
|
97 |
// Next `cast_*` lints don't give alternatives.
|
98 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
99 |
// Next lints produce too much noise/false positives.
|
74 |
clippy::wildcard_imports, // for autogen protocol.rs
|
75 |
clippy::cast_possible_truncation, // for types.rs:189 & 190
|
76 |
clippy::cast_sign_loss, // for tab/element/mod.rs:492 & 493
|
10 |
#![allow(clippy::struct_excessive_bools)]
|
11 |
#![allow(clippy::cast_possible_truncation)]
|
12 |
#![allow(clippy::cast_precision_loss)]
|
6 |
clippy::cast_sign_loss,
|
7 |
clippy::cast_possible_truncation
|
8 |
)]
|
40 |
clippy::doc_markdown,
|
41 |
clippy::cast_possible_truncation, //
|
42 |
clippy::integer_arithmetic, //
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
24 |
clippy::cast_lossless,
|
25 |
clippy::cast_possible_truncation,
|
26 |
clippy::cast_possible_wrap,
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
24 |
clippy::cast_lossless,
|
25 |
clippy::cast_possible_truncation,
|
26 |
clippy::cast_possible_wrap,
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
97 |
// Next `cast_*` lints don't give alternatives.
|
98 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
99 |
// Next lints produce too much noise/false positives.
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
1 |
#![allow(clippy::shadow_unrelated)]
|
2 |
#![allow(clippy::cast_possible_truncation)]
|
3 |
use super::*;
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
15 |
#![allow(clippy::module_name_repetitions)]
|
16 |
#![allow(clippy::cast_possible_truncation)] // TODO: Revisit all occurrences
|
17 |
#![warn(rustdoc::broken_intra_doc_links)]
|
75 |
#![allow(clippy::nonminimal_bool)]
|
76 |
#![allow(clippy::cast_possible_truncation)]
|
77 |
#![allow(clippy::cast_sign_loss)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
3 |
// Allowed as they are too pedantic.
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::unreadable_literal,
|
19 |
#![allow(clippy::missing_errors_doc)]
|
20 |
#![allow(clippy::cast_possible_truncation)]
|
21 |
#![allow(clippy::too_many_lines)]
|
1 |
#![allow(clippy::module_inception, clippy::option_option, clippy::cast_sign_loss, clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_lossless)]
|
1 |
#![allow(clippy::cast_possible_truncation)]
|
17 |
clippy::cast_sign_loss,
|
18 |
clippy::cast_possible_truncation
|
19 |
)]
|
230 |
incomplete_features,
|
231 |
clippy::cast_possible_truncation,
|
232 |
clippy::cast_lossless,
|
191 |
)]
|
192 |
#![allow(clippy::cast_possible_truncation, clippy::must_use_candidate)]
|
1 |
#![allow(
|
2 |
clippy::cast_possible_truncation,
|
3 |
clippy::cast_possible_wrap,
|
2 |
#![allow(clippy::cast_sign_loss)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
4 |
#![allow(clippy::cast_possible_wrap)]
|
5 |
// values are truncated here instead of using TryFrom.
|
6 |
#![allow(clippy::cast_possible_truncation)]
|
26 |
inline_always,
|
27 |
cast_possible_truncation,
|
28 |
needless_pass_by_value,
|
3 |
clippy::cast_precision_loss,
|
4 |
clippy::cast_possible_truncation
|
5 |
)]
|
4 |
clippy::cast_possible_wrap,
|
5 |
clippy::cast_possible_truncation,
|
6 |
clippy::cast_sign_loss
|
2 |
#![allow(
|
3 |
clippy::cast_possible_truncation,
|
4 |
clippy::cast_possible_wrap,
|
2 |
clippy::cast_lossless,
|
3 |
clippy::cast_possible_truncation,
|
4 |
clippy::doc_markdown,
|
97 |
clippy::cast_lossless,
|
98 |
clippy::cast_possible_truncation,
|
99 |
clippy::doc_markdown,
|
14 |
#![allow(clippy::cast_precision_loss)]
|
15 |
#![allow(clippy::cast_possible_truncation)]
|
16 |
#![allow(clippy::cast_sign_loss)]
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_possible_wrap,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_possible_wrap,
|
3 |
clippy::borrow_deref_ref,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_possible_wrap,
|
3 |
clippy::borrow_deref_ref,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_possible_wrap,
|
3 |
#![allow(clippy::cast_precision_loss)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::module_name_repetitions)]
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_sign_loss
|
70 |
// Due to the high amount of byte conversions, sometimes intentional lossy conversions are necessary.
|
71 |
#![allow(clippy::cast_possible_truncation)]
|
72 |
// same as above
|
4 |
clippy::cast_possible_wrap,
|
5 |
clippy::cast_possible_truncation,
|
6 |
clippy::cast_sign_loss
|
52 |
#![deny(clippy::pedantic)]
|
53 |
#![allow(clippy::cast_lossless, clippy::cast_possible_truncation)]
|
6 |
clippy::cast_sign_loss,
|
7 |
clippy::cast_possible_truncation,
|
8 |
clippy::cast_precision_loss,
|
5 |
#![allow(clippy::cast_possible_wrap)]
|
6 |
#![allow(clippy::cast_possible_truncation)]
|
2 |
#![allow(clippy::cast_sign_loss)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
4 |
#![allow(clippy::cast_precision_loss)]
|
255 |
#![allow(
|
256 |
clippy::cast_possible_truncation,
|
257 |
clippy::cast_sign_loss,
|
230 |
mod test {
|
231 |
#![allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
1 |
#![allow(clippy::cast_possible_truncation)]
|
2 |
#![allow(clippy::unnecessary_cast)]
|
59 |
// Next `cast_*` lints don't give alternatives.
|
60 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
61 |
// Next lints produce too much noise/false positives.
|
59 |
// Next `cast_*` lints don't give alternatives.
|
60 |
clippy::cast_possible_wrap, clippy::cast_possible_truncation, clippy::cast_sign_loss,
|
61 |
// Next lints produce too much noise/false positives.
|
81 |
clippy::cast_sign_loss,
|
82 |
clippy::cast_possible_truncation,
|
83 |
clippy::cast_possible_wrap
|
7 |
#![warn(clippy::decimal_literal_representation)]
|
8 |
#![allow(clippy::cast_possible_truncation)]
|
64 |
clippy::indexing_slicing,
|
65 |
clippy::cast_possible_truncation,
|
66 |
clippy::integer_arithmetic,
|
23 |
clippy::indexing_slicing,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::integer_arithmetic,
|
6 |
//! [new]: https://gmplib.org/list-archives/gmp-devel/2019-October/005590.html
|
7 |
#![allow(dead_code, clippy::cast_possible_truncation, clippy::cast_lossless)]
|
7 |
// Truncation is intentional
|
8 |
#![allow(clippy::cast_possible_truncation)]
|
9 |
#![allow(dead_code)] // TODO
|
149 |
clippy::cast_lossless,
|
150 |
clippy::cast_possible_truncation,
|
151 |
clippy::derive_partial_eq_without_eq,
|
1 |
#![warn(clippy::all, clippy::pedantic)]
|
2 |
#![allow(clippy::cast_precision_loss, clippy::cast_possible_truncation)]
|
3 |
mod game;
|
86 |
clippy::cast_lossless,
|
87 |
clippy::cast_possible_truncation,
|
88 |
clippy::cast_possible_wrap,
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
24 |
clippy::cast_lossless,
|
25 |
clippy::cast_possible_truncation,
|
26 |
clippy::cast_possible_wrap,
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
60 |
clippy::cast_lossless,
|
61 |
clippy::cast_possible_truncation,
|
62 |
clippy::cast_possible_wrap,
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
25 |
clippy::cast_lossless,
|
26 |
clippy::cast_possible_truncation,
|
27 |
clippy::cast_possible_wrap,
|
23 |
clippy::cast_lossless,
|
24 |
clippy::cast_possible_truncation,
|
25 |
clippy::cast_possible_wrap,
|
92 |
clippy::cast_lossless,
|
93 |
clippy::cast_possible_truncation,
|
94 |
clippy::doc_markdown,
|
4 |
#![warn(clippy::pedantic)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(clippy::cast_possible_wrap)]
|
70 |
clippy::cast_lossless,
|
71 |
clippy::cast_possible_truncation,
|
72 |
clippy::doc_markdown,
|
77 |
clippy::cast_lossless,
|
78 |
clippy::cast_possible_truncation,
|
79 |
clippy::derive_partial_eq_without_eq,
|
114 |
// integer and float ser/de requires these sorts of casts
|
115 |
cast_possible_truncation,
|
116 |
cast_possible_wrap,
|
2 |
clippy::cast_lossless,
|
3 |
clippy::cast_possible_truncation,
|
4 |
clippy::missing_errors_doc
|
39 |
#![allow(
|
40 |
clippy::cast_possible_truncation,
|
41 |
clippy::checked_conversions,
|
33 |
#![allow(
|
34 |
clippy::cast_possible_truncation,
|
35 |
clippy::checked_conversions,
|
332 |
// integer and float ser/de requires these sorts of casts
|
333 |
clippy::cast_possible_truncation,
|
334 |
clippy::cast_possible_wrap,
|
2 |
clippy::cast_lossless,
|
3 |
clippy::cast_possible_truncation,
|
4 |
clippy::cast_possible_wrap,
|
330 |
// integer and float ser/de requires these sorts of casts
|
331 |
cast_possible_truncation,
|
332 |
cast_possible_wrap,
|
333 |
// integer and float ser/de requires these sorts of casts
|
334 |
clippy::cast_possible_truncation,
|
335 |
clippy::cast_possible_wrap,
|
325 |
// integer and float ser/de requires these sorts of casts
|
326 |
clippy::cast_possible_truncation,
|
327 |
clippy::cast_possible_wrap,
|
141 |
clippy::blocks_in_if_conditions,
|
142 |
clippy::cast_possible_truncation,
|
143 |
clippy::cast_possible_wrap,
|
63 |
// Allowed as they are too pedantic
|
64 |
clippy::cast_possible_truncation,
|
65 |
clippy::unreadable_literal,
|
28 |
// it's usually not needed.
|
29 |
#![allow(clippy::cast_possible_truncation, clippy::cast_lossless)]
|
7 |
#![allow(
|
8 |
clippy::cast_possible_truncation,
|
9 |
clippy::needless_collect,
|
41 |
// disabled individual clippy linters
|
42 |
#![allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
14 |
#![allow(
|
15 |
clippy::cast_possible_truncation,
|
16 |
clippy::cast_precision_loss,
|
93 |
impl Arbitrary for Key {
|
94 |
#![allow(clippy::cast_possible_truncation)]
|
95 |
#![allow(clippy::cast_precision_loss)]
|
137 |
clippy::cast_sign_loss,
|
138 |
clippy::cast_possible_truncation,
|
139 |
clippy::inline_always,
|
137 |
clippy::cast_sign_loss,
|
138 |
clippy::cast_possible_truncation,
|
139 |
clippy::inline_always,
|
27 |
inline_always,
|
28 |
cast_possible_truncation,
|
29 |
needless_pass_by_value,
|
27 |
inline_always,
|
28 |
cast_possible_truncation,
|
29 |
needless_pass_by_value,
|
10 |
#![allow(clippy::must_use_candidate)]
|
11 |
#![allow(clippy::cast_possible_truncation)]
|
12 |
#![allow(clippy::items_after_statements)]
|
46 |
clippy::missing_errors_doc,
|
47 |
clippy::cast_possible_truncation,
|
48 |
clippy::unseparated_literal_suffix
|
2 |
#![allow(clippy::too_many_lines)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
4 |
#![allow(clippy::map_unwrap_or)]
|
2 |
#![deny(clippy::pedantic)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
4 |
#![allow(clippy::cast_precision_loss)]
|
2 |
#![deny(clippy::pedantic)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
14 |
#![deny(clippy::pedantic)]
|
15 |
#![allow(clippy::cast_possible_truncation)]
|
16 |
#![allow(clippy::cast_precision_loss)]
|
3 |
clippy::cast_sign_loss,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::module_name_repetitions,
|
58 |
#![allow(
|
59 |
clippy::cast_possible_truncation,
|
60 |
clippy::cast_possible_wrap,
|
9 |
#![allow(
|
10 |
clippy::cast_possible_truncation,
|
11 |
clippy::cast_possible_wrap,
|
25 |
#![allow(clippy::pedantic)]
|
26 |
#![allow(clippy::cast_possible_truncation)]
|
27 |
#![allow(clippy::cast_sign_loss)]
|
3 |
#![warn(clippy::pedantic)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::cast_possible_wrap)]
|
10 |
#![allow(clippy::indexing_slicing)]
|
11 |
#![allow(clippy::cast_possible_truncation)]
|
12 |
#![allow(clippy::implicit_return)]
|
62 |
#![allow(
|
63 |
clippy::cast_possible_truncation,
|
64 |
clippy::cast_possible_wrap,
|
4 |
#![warn(clippy::cargo)]
|
5 |
#![allow(clippy::cast_possible_truncation)]
|
6 |
#![allow(unknown_lints)]
|
206 |
clippy::must_use_candidate,
|
207 |
clippy::cast_possible_truncation,
|
208 |
// Below items are from "restriction"
|
6 |
#![allow(clippy::cast_sign_loss)]
|
7 |
#![allow(clippy::cast_possible_truncation)]
|
8 |
#![allow(clippy::cast_possible_wrap)]
|
59 |
clippy::items_after_statements,
|
60 |
clippy::cast_possible_truncation,
|
61 |
clippy::module_name_repetitions,
|
258 |
clippy::cast_lossless,
|
259 |
clippy::cast_possible_truncation,
|
260 |
clippy::cast_possible_wrap,
|
263 |
#![allow(
|
264 |
clippy::cast_possible_truncation,
|
265 |
clippy::empty_enum,
|
262 |
#![allow(
|
263 |
clippy::cast_possible_truncation,
|
264 |
clippy::empty_enum,
|
249 |
allow(
|
250 |
cast_possible_truncation,
|
251 |
cast_possible_wrap,
|
36 |
fn basic() {
|
37 |
#![allow(clippy::cast_possible_truncation)]
|
38 |
for i in 0..64 {
|
64 |
fn overaligned() {
|
65 |
#![allow(clippy::cast_possible_truncation)]
|
66 |
for i in 0..64 {
|
1 |
#![allow(clippy::cast_possible_truncation)]
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::manual_find,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::manual_map,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::manual_find,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::manual_map,
|
34 |
clippy::cast_lossless,
|
35 |
clippy::cast_possible_truncation,
|
36 |
clippy::cast_possible_wrap,
|
2 |
#![allow(clippy::cast_precision_loss)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
4 |
#![allow(clippy::module_name_repetitions)]
|
2 |
#![allow(clippy::too_many_lines)]
|
3 |
#![allow(clippy::cast_possible_truncation)]
|
4 |
#![allow(clippy::map_unwrap_or)]
|
84 |
#![warn(clippy::pedantic, missing_docs)]
|
85 |
#![allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
|
86 |
use std::result::Result as StdResult;
|
1164 |
mod tests_collection {
|
1165 |
#![allow(clippy::cast_possible_truncation)]
|
1166 |
use super::*;
|
15 |
#![allow(
|
16 |
clippy::cast_possible_truncation,
|
17 |
clippy::cast_sign_loss,
|
6 |
clippy::missing_const_for_fn,
|
7 |
clippy::cast_possible_truncation,
|
8 |
clippy::missing_errors_doc
|
7 |
clippy::cast_sign_loss,
|
8 |
clippy::cast_possible_truncation,
|
9 |
clippy::redundant_pub_crate,
|
2 |
#![allow(
|
3 |
clippy::cast_possible_truncation,
|
4 |
clippy::cast_sign_loss,
|
80 |
clippy::cast_precision_loss,
|
81 |
clippy::cast_possible_truncation
|
82 |
)]
|
334 |
pub fn partial_update(&mut self, region: UpdateRegion) -> Result<(), SpiDataError> {
|
335 |
#![allow(clippy::cast_possible_truncation)]
|
109 |
clippy::must_use_candidate,
|
110 |
clippy::cast_possible_truncation
|
111 |
)]
|
11 |
clippy::must_use_candidate,
|
12 |
clippy::cast_possible_truncation
|
13 |
)]
|
7 |
clippy::match_wildcard_for_single_variants,
|
8 |
clippy::cast_possible_truncation,
|
9 |
clippy::cast_sign_loss,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_possible_wrap,
|
3 |
clippy::cast_lossless,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_possible_wrap,
|
13 |
clippy::cast_lossless,
|
14 |
clippy::cast_possible_truncation,
|
15 |
clippy::cast_possible_wrap,
|
39 |
clippy::cast_lossless,
|
40 |
clippy::cast_possible_truncation,
|
41 |
clippy::items_after_statements
|
216 |
#![allow(non_camel_case_types, non_snake_case,
|
217 |
clippy::cast_possible_truncation,
|
218 |
clippy::cast_lossless,
|
3 |
#![warn(clippy::pedantic)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::cast_possible_wrap)]
|
93 |
impl Arbitrary for Key {
|
94 |
#![allow(clippy::cast_possible_truncation)]
|
95 |
#![allow(clippy::cast_precision_loss)]
|
28 |
clippy::missing_panics_doc,
|
29 |
clippy::cast_possible_truncation,
|
30 |
clippy::cast_sign_loss,
|
2 |
#![allow(
|
3 |
clippy::cast_possible_truncation,
|
4 |
clippy::cast_sign_loss,
|
1 |
#![allow(clippy::cast_possible_truncation)]
|
2 |
#![allow(clippy::cast_precision_loss)]
|
8 |
#![allow(clippy::cast_sign_loss)]
|
9 |
#![allow(clippy::cast_possible_truncation)]
|
10 |
#![allow(clippy::similar_names)]
|
3 |
#![allow(clippy::non_ascii_literal)]
|
4 |
#![allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::option_if_let_else)]
|
5 |
#![warn(clippy::pedantic)]
|
6 |
#![allow(clippy::cast_possible_truncation)]
|
7 |
#![allow(clippy::cast_possible_wrap)]
|
3 |
#![warn(clippy::pedantic)]
|
4 |
#![allow(clippy::cast_possible_truncation)]
|
5 |
#![allow(clippy::cast_possible_wrap)]
|
41 |
// TODO - Investigate possible truncation
|
42 |
#![allow(clippy::cast_possible_truncation)]
|
43 |
// TODO: Fix false positives
|
26 |
clippy::wildcard_imports,
|
27 |
clippy::cast_possible_truncation,
|
28 |
clippy::too_many_arguments,
|
3 |
clippy::similar_names,
|
4 |
clippy::cast_possible_truncation,
|
5 |
clippy::cast_sign_loss,
|