mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Clippy
This commit is contained in:
parent
e626bac931
commit
669d69c4cf
1 changed files with 4 additions and 4 deletions
|
@ -15,7 +15,7 @@ trait CopyEnv {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn clear_source_copy(&mut self, var: Variable) {
|
fn clear_source_copy(&mut self, var: Variable) {
|
||||||
self.mut_source().modify(var, |descriptor| {
|
self.mut_source().modify(var, |descriptor| {
|
||||||
if let Some(_) = descriptor.copy.into_variable() {
|
if descriptor.copy.into_variable().is_some() {
|
||||||
descriptor.copy = OptVariable::NONE;
|
descriptor.copy = OptVariable::NONE;
|
||||||
} else {
|
} else {
|
||||||
debug_assert!(false, "{:?} marked as copied but it wasn't", var);
|
debug_assert!(false, "{:?} marked as copied but it wasn't", var);
|
||||||
|
@ -193,7 +193,7 @@ pub fn deep_copy_expr_across_subs(
|
||||||
|
|
||||||
/// Deep copies all type variables in [`expr`].
|
/// Deep copies all type variables in [`expr`].
|
||||||
/// Returns [`None`] if the expression does not need to be copied.
|
/// Returns [`None`] if the expression does not need to be copied.
|
||||||
fn deep_copy_type_vars_into_expr_help<'a, C: CopyEnv>(
|
fn deep_copy_type_vars_into_expr_help<C: CopyEnv>(
|
||||||
env: &mut C,
|
env: &mut C,
|
||||||
var: Variable,
|
var: Variable,
|
||||||
expr: &Expr,
|
expr: &Expr,
|
||||||
|
@ -219,7 +219,7 @@ fn deep_copy_type_vars_into_expr_help<'a, C: CopyEnv>(
|
||||||
|
|
||||||
return Some((copy_expr_var, copied_expr));
|
return Some((copy_expr_var, copied_expr));
|
||||||
|
|
||||||
fn help<'a, C: CopyEnv>(env: &mut C, expr: &Expr, copied: &mut Vec<Variable>) -> Expr {
|
fn help<C: CopyEnv>(env: &mut C, expr: &Expr, copied: &mut Vec<Variable>) -> Expr {
|
||||||
use Expr::*;
|
use Expr::*;
|
||||||
|
|
||||||
macro_rules! sub {
|
macro_rules! sub {
|
||||||
|
@ -563,7 +563,7 @@ fn deep_copy_type_vars_into_expr_help<'a, C: CopyEnv>(
|
||||||
/// Deep copies the type variables in [`var`], returning a map of original -> new type variable for
|
/// Deep copies the type variables in [`var`], returning a map of original -> new type variable for
|
||||||
/// all type variables copied.
|
/// all type variables copied.
|
||||||
#[inline]
|
#[inline]
|
||||||
fn deep_copy_type_vars<'a, C: CopyEnv>(
|
fn deep_copy_type_vars<C: CopyEnv>(
|
||||||
env: &mut C,
|
env: &mut C,
|
||||||
copied: &mut Vec<Variable>,
|
copied: &mut Vec<Variable>,
|
||||||
var: Variable,
|
var: Variable,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue