ronantakizawa/codereview-bench huggingface dataset:
Repository: Blaizzy/mlx-audio
File: mlx_audio/codec/models/bigvgan/bigvgan.py (Python)

Code before:
from dataclasses import dataclass
from typing import Literal

import mlx.core as mx
import mlx.nn as nn

from mlx_audio.codec.models.bigvgan.activation import Snake, SnakeBeta
from mlx_audio.codec.models.bigvgan.amp import AMPBlock1, AMPBlock2
from mlx_audio.codec.models.bigvgan.resample import Activation1d


@dataclass
class BigVGANConfig:
    num_mels: int
    upsample_rates: list[int]
    upsample_kernel_sizes: list[int]
    upsample_initial_channel: int
    resblock: Literal["1", "2"]  # no idea why it's string in config
    resblock_kernel_sizes: list[int]
    resblock_dilation_sizes: list[list[int]]
    activation: Literal["snakebeta", "snake"]
    snake_logscale: bool
    use_bias_at_final: bool = True  # compatability
    use_tanh_at_final: bool = True  # compatability


class BigVGAN(nn.Module):
    def __init__(self, config: BigVGANConfig):
        super().__init__()

        self.num_kernels = len(config.resblock_kernel_sizes)
        self.num_upsamples = len(config.upsample_rates)
        self.use_tanh_at_final = config.use_tanh_at_final

        self.conv_pre = nn.Conv1d(
            config.num_mels, config.upsample_initial_channel, 7, 1, 3
        )
        self.ups = [
            [
                nn.ConvTranspose1d(
                    config.upsample_initial_channel // (2**i),
                    config.upsample_initial_channel // (2 ** (i + 1)),
                    k,

Review comment (suggestion):
```suggestion
    resblock: Literal["1", "2"]
```

Code after:
from dataclasses import dataclass
from typing import Literal

import mlx.core as mx
import mlx.nn as nn

from mlx_audio.codec.models.bigvgan.activation import Snake, SnakeBeta
from mlx_audio.codec.models.bigvgan.amp import AMPBlock1, AMPBlock2
from mlx_audio.codec.models.bigvgan.resample import Activation1d


@dataclass
class BigVGANConfig:
    num_mels: int
    upsample_rates: list[int]
    upsample_kernel_sizes: list[int]
    upsample_initial_channel: int
    resblock: Literal["1", "2"]
    resblock_kernel_sizes: list[int]
    resblock_dilation_sizes: list[list[int]]
    activation: Literal["snakebeta", "snake"]
    snake_logscale: bool
    use_bias_at_final: bool = True  # compatability
    use_tanh_at_final: bool = True  # compatability


class BigVGAN(nn.Module):
    def __init__(self, config: BigVGANConfig):
        super().__init__()

        self.num_kernels = len(config.resblock_kernel_sizes)
        self.num_upsamples = len(config.upsample_rates)
        self.use_tanh_at_final = config.use_tanh_at_final

        self.conv_pre = nn.Conv1d(
            config.num_mels, config.upsample_initial_channel, 7, 1, 3
        )
        self.ups = [
            [
                nn.ConvTranspose1d(
                    config.upsample_initial_channel // (2**i),
                    config.upsample_initial_channel // (2 ** (i + 1)),
                    k,
Repository: BurntSushi/ripgrep
File: tests/tests.rs (Rust)

Code before:
}

// See: https://github.com/BurntSushi/ripgrep/issues/391
#[test]
fn regression_391() {
    let wd = WorkDir::new("regression_391");
    wd.create_dir(".git");
    wd.create("lock", "");
    wd.create("bar.py", "");
    wd.create(".git/packed-refs", "");
    wd.create(".git/description", "");

    let mut cmd = wd.command();
    cmd.arg("--no-ignore").arg("--hidden").arg("--follow").arg("--files")
        .arg("--glob")
        .arg("!{.git,node_modules,plugged}/**")
        .arg("--glob")
        .arg("*.{js,json,php,md,styl,scss,sass,pug,html,config,py,cpp,c,go,hs}");

    let lines: String = wd.stdout(&mut cmd);
    assert_eq!(lines, "bar.py\n");
}

#[test]
fn type_list() {
    let wd = WorkDir::new("type_list");

    let mut cmd = wd.command();
    cmd.arg("--type-list");
    let lines: String = wd.stdout(&mut cmd);
    // This can change over time, so just make sure we print something.
    assert!(!lines.is_empty());
}


Review comment (bug):
This test looks good. Could you add another test that approximately mimics the bug report in #451? e.g., Test that the actual results printed are correct instead of just column numbers.

Code after:
}

// See: https://github.com/BurntSushi/ripgrep/issues/391
#[test]
fn regression_391() {
    let wd = WorkDir::new("regression_391");
    wd.create_dir(".git");
    wd.create("lock", "");
    wd.create("bar.py", "");
    wd.create(".git/packed-refs", "");
    wd.create(".git/description", "");

    let mut cmd = wd.command();
    cmd.arg("--no-ignore").arg("--hidden").arg("--follow").arg("--files")
        .arg("--glob")
        .arg("!{.git,node_modules,plugged}/**")
        .arg("--glob")
        .arg("*.{js,json,php,md,styl,scss,sass,pug,html,config,py,cpp,c,go,hs}");

    let lines: String = wd.stdout(&mut cmd);
    assert_eq!(lines, "bar.py\n");
}

// See: https://github.com/BurntSushi/ripgrep/issues/451
#[test]
fn regression_451_only_matching_as_in_issue() {
    let wd = WorkDir::new("regression_451_only_matching");
    let path = "digits.txt";
    wd.create(path, "1 2 3\n");

    let mut cmd = wd.command();
    cmd.arg("[0-9]+").arg(path).arg("--only-matching");
    let lines: String = wd.stdout(&mut cmd);

    let expected = "\
1
2
3
";

    assert_eq!(lines, expected);
}

// See: https://github.com/BurntSushi/ripgrep/issues/451
#[test]
fn regression_451_only_matching() {
    let wd = WorkDir::new("regression_451_only_matching");
    let path = "digits.txt";
    wd.create(path, "1 2 3\n123\n");

    let mut cmd = wd.command();
Repository: BurntSushi/ripgrep
File: src/app.rs (Rust)

Code before:
use std::collections::HashMap;

use clap::{App, AppSettings, Arg, ArgSettings};

const ABOUT: &'static str = "
ripgrep (rg) recursively searches your current directory for a regex pattern.

ripgrep's regex engine uses finite automata and guarantees linear time
searching. Because of this, features like backreferences and arbitrary
lookaround are not supported.

Project home page: https://github.com/BurntSushi/ripgrep

Use -h for short descriptions and --help for more details.";

const USAGE: &'static str = "
    rg [OPTIONS] <pattern> [<path> ...]
    rg [OPTIONS] [-e PATTERN | -f FILE ]... [<path> ...]
    rg [OPTIONS] --files [<path> ...]
    rg [OPTIONS] --type-list";

const TEMPLATE: &'static str = "\
{bin} {version}
{author}
{about}

USAGE:{usage}

ARGS:
{positionals}

OPTIONS:
{unified}";

/// Build a clap application parameterized by usage strings.
///
/// The function given should take a clap argument name and return a help
/// string. `app` will panic if a usage string is not defined.
///
/// This is an intentionally stand-alone module so that it can be used easily
/// in a `build.rs` script to build shell completion files.
pub fn app() -> App<'static, 'static> {
    let arg = |name| {

Review comment (suggestion):
I think there should be `...` following `(-e PATTERN | -f FILE)`.

Code after:
use std::collections::HashMap;

use clap::{App, AppSettings, Arg, ArgSettings};

const ABOUT: &'static str = "
ripgrep (rg) recursively searches your current directory for a regex pattern.

ripgrep's regex engine uses finite automata and guarantees linear time
searching. Because of this, features like backreferences and arbitrary
lookaround are not supported.

Project home page: https://github.com/BurntSushi/ripgrep

Use -h for short descriptions and --help for more details.";

const USAGE: &'static str = "
    rg [options] PATTERN [path ...]
    rg [options] [-e pattern ...] [-f file ...] [path ...]
    rg [options] --files [path ...]
    rg [options] --type-list";

const TEMPLATE: &'static str = "\
{bin} {version}
{author}
{about}

USAGE:{usage}

ARGS:
{positionals}

OPTIONS:
{unified}";

/// Build a clap application parameterized by usage strings.
///
/// The function given should take a clap argument name and return a help
/// string. `app` will panic if a usage string is not defined.
///
/// This is an intentionally stand-alone module so that it can be used easily
/// in a `build.rs` script to build shell completion files.
pub fn app() -> App<'static, 'static> {
    let arg = |name| {
Repository: BurntSushi/ripgrep
File: ci/utils.sh (Shell)

Code before:
mktempd() {
    echo $(mktemp -d 2>/dev/null || mktemp -d -t tmp)
}

host() {
    case "$TRAVIS_OS_NAME" in
        linux)
            echo x86_64-unknown-linux-gnu
            ;;
        osx)
            echo x86_64-apple-darwin
            ;;
    esac
}

gcc_prefix() {
    case "$TARGET" in
        aarch64-unknown-linux-gnu)
            echo aarch64-linux-gnu-
            ;;
        arm*-gnueabihf)
            echo arm-linux-gnueabihf-
            ;;
        *)
            return
            ;;
    esac
}

dobin() {
    [ -z $MAKE_DEB ] && die 'dobin: $MAKE_DEB not set'
    [ $# -lt 1 ] && die "dobin: at least one argument needed"

    local f prefix=$(gcc_prefix)
    for f in "$@"; do
        install -m0755 $f $dtd/debian/usr/bin/
        ${prefix}strip -s $dtd/debian/usr/bin/$(basename $f)
    done
}

architecture() {
    case $1 in
        x86_64-unknown-linux-gnu|x86_64-unknown-linux-musl)
            echo amd64
            ;;
        i686-unknown-linux-gnu|i686-unknown-linux-musl)
            echo i386
            ;;
        arm*-unknown-linux-gnueabihf)
            echo armhf
            ;;
        *)
            die "architecture: unexpected target $TARGET"
            ;;
    esac
}


Review comment (bug):
Having a shell function return `1` on success/true and `0` on failure/false is pretty unorthodox. Also there's a lot of unnecessary forking here. It doesn't really matter, it's not like it's performance-critical or anything, but (in the spirit of some of your other changes) it would probably be more idiomatic to do something like this:

```sh
case "${TARGET}" in
  i686-unknown-netbsd) return 1 ;;
  i686*|x86_64*)       return 0 ;;
esac
return 1
```

Then you can use it like:

```sh
if is_ssse3_target; then
  # do SSSE3 stuff
else
  # do not-SSSE3 stuff
fi
```

Code after:

    local f prefix=$(gcc_prefix)
    for f in "$@"; do
        install -m0755 $f $dtd/debian/usr/bin/
        ${prefix}strip -s $dtd/debian/usr/bin/$(basename $f)
    done
}

architecture() {
    case ${TARGET:?} in
        x86_64-*)
            echo amd64
            ;;
        i686-*|i586-*|i386-*)
            echo i386
            ;;
        arm*-unknown-linux-gnueabihf)
            echo armhf
            ;;
        *)
            die "architecture: unexpected target $TARGET"
            ;;
    esac
}

is_ssse3_target() {
    case "${TARGET}" in
        i686-unknown-netbsd) return 1 ;; # i686-unknown-netbsd - SSE2
        i686*|x86_64*)       return 0 ;;
    esac
    return 1
}
Repository: BurntSushi/ripgrep
File: ci/before_deploy.sh (Shell)

Code before:
# `before_deploy` phase: here we package the build artifacts

set -ex

. $(dirname $0)/utils.sh

# Generate artifacts for release
mk_artifacts() {
    RUSTFLAGS="-C target-feature=+ssse3" \
      cargo build --target $TARGET --release --features simd-accel
}

mk_tarball() {
    # create a "staging" directory
    local td=$(mktempd)
    local out_dir=$(pwd)
    local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
    mkdir "$td/$name"
    mkdir "$td/$name/complete"

    cp target/$TARGET/release/rg "$td/$name/rg"
    strip "$td/$name/rg"
    cp {doc/rg.1,README.md,UNLICENSE,COPYING,LICENSE-MIT} "$td/$name/"
    cp \
      target/$TARGET/release/build/ripgrep-*/out/{rg.bash-completion,rg.fish,_rg.ps1} \
      "$td/$name/complete/"
    cp complete/_rg "$td/$name/complete/"

    pushd $td
    tar czf "$out_dir/$name.tar.gz" *
    popd
    rm -r $td
}

main() {

Review comment (suggestion):
Related to my other comment: I don't believe this construction will work reliably anyway — if `is_ssse3_target` returns `1` here, it will cause the script to bail because of `set -e`. The effect of `set -e` needs to be suppressed by putting it in the `if` condition (or using `||` or `&&`)

Code after:
# `before_deploy` phase: here we package the build artifacts

set -ex

. $(dirname $0)/utils.sh

# Generate artifacts for release
mk_artifacts() {
    if is_ssse3_target; then
        RUSTFLAGS="-C target-feature=+ssse3" \
        cargo build --target $TARGET --release --features simd-accel
    else
        cargo build --target $TARGET --release
    fi
}

mk_tarball() {
    # create a "staging" directory
    local td=$(mktempd)
    local out_dir=$(pwd)
    local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}"
    local gcc_prefix="$(gcc_prefix)"
    mkdir "${td:?}/${name}"
    mkdir "$td/$name/complete"

    cp target/$TARGET/release/rg "$td/$name/rg"
    ${gcc_prefix}strip "$td/$name/rg"
    cp {doc/rg.1,README.md,UNLICENSE,COPYING,LICENSE-MIT} "$td/$name/"
    cp \
      target/$TARGET/release/build/ripgrep-*/out/{rg.bash-completion,rg.fish,_rg.ps1} \
      "$td/$name/complete/"
    cp complete/_rg "$td/$name/complete/"

    pushd $td
    tar czf "$out_dir/$name.tar.gz" *
Repository: BurntSushi/ripgrep
File: ci/utils.sh (Shell)

Code before:
mktempd() {
    echo $(mktemp -d 2>/dev/null || mktemp -d -t tmp)
}

host() {
    case "$TRAVIS_OS_NAME" in
        linux)
            echo x86_64-unknown-linux-gnu
            ;;
        osx)
            echo x86_64-apple-darwin
            ;;
    esac
}

gcc_prefix() {
    case "$TARGET" in
        aarch64-unknown-linux-gnu)
            echo aarch64-linux-gnu-
            ;;
        arm*-gnueabihf)
            echo arm-linux-gnueabihf-
            ;;
        *)
            return
            ;;
    esac
}

dobin() {
    [ -z $MAKE_DEB ] && die 'dobin: $MAKE_DEB not set'
    [ $# -lt 1 ] && die "dobin: at least one argument needed"

    local f prefix=$(gcc_prefix)
    for f in "$@"; do
        install -m0755 $f $dtd/debian/usr/bin/
        ${prefix}strip -s $dtd/debian/usr/bin/$(basename $f)
    done
}

architecture() {
    case $1 in
        x86_64-unknown-linux-gnu|x86_64-unknown-linux-musl)
            echo amd64
            ;;
        i686-unknown-linux-gnu|i686-unknown-linux-musl)
            echo i386
            ;;
        arm*-unknown-linux-gnueabihf)
            echo armhf
            ;;
        *)
            die "architecture: unexpected target $TARGET"
            ;;
    esac
}


Review comment (refactor):
I think you can just remove this comment. As @okdana said, `1` for `false` is standard in shell scripts.

Code after:
    local f prefix=$(gcc_prefix)
    for f in "$@"; do
        install -m0755 $f $dtd/debian/usr/bin/
        ${prefix}strip -s $dtd/debian/usr/bin/$(basename $f)
    done
}

architecture() {
    case ${TARGET:?} in
        x86_64-*)
            echo amd64
            ;;
        i686-*|i586-*|i386-*)
            echo i386
            ;;
        arm*-unknown-linux-gnueabihf)
            echo armhf
            ;;
        *)
            die "architecture: unexpected target $TARGET"
            ;;
    esac
}

is_ssse3_target() {
    case "${TARGET}" in
        i686-unknown-netbsd) return 1 ;; # i686-unknown-netbsd - SSE2
        i686*|x86_64*)       return 0 ;;
    esac
    return 1
}
Repository: BurntSushi/ripgrep
File: crates/ignore/src/default_types.rs (Rust)

Code before:
        "*.vim", ".vimrc", ".gvimrc", "vimrc", "gvimrc", "_vimrc", "_gvimrc",
    ]),
    ("webidl", &["*.idl", "*.webidl", "*.widl"]),
    ("wiki", &["*.mediawiki", "*.wiki"]),
    ("xml", &[
        "*.xml", "*.xml.dist", "*.dtd", "*.xsl", "*.xslt", "*.xsd", "*.xjb",
        "*.rng", "*.sch", "*.xhtml",
    ]),
    ("xz", &["*.xz", "*.txz"]),
    ("yacc", &["*.y"]),
    ("yaml", &["*.yaml", "*.yml"]),
    ("yang", &["*.yang"]),
    ("z", &["*.Z"]),
    ("zig", &["*.zig"]),
    ("zsh", &[
        ".zshenv", "zshenv",
        ".zlogin", "zlogin",
        ".zlogout", "zlogout",
        ".zprofile", "zprofile",
        ".zshrc", "zshrc",
        "*.zsh",
    ]),
    ("zstd", &["*.zst", "*.zstd"]),
];

#[test]
fn test_default_types_are_sorted() {
    let mut names = DEFAULT_TYPES.iter().map(|(name, _exts)| name);

    if let Some(first) = names.next() {
        let mut previous_name = first;
        for name in names {
            assert!(
                name > previous_name,
                r#""{}" should be sorted before "{}" in `DEFAULT_TYPES`"#,
                name,
                previous_name
            );

            previous_name = name;
        }
    }
}


Review comment (suggestion):
The test should be in a `#[cfg(test)] mod tests { ... }` block. It doesn't have to be, but this is the pattern followed in this repo and clearly delineates tests from non-tests.

Code after:
    ("vimscript", &[
        "*.vim", ".vimrc", ".gvimrc", "vimrc", "gvimrc", "_vimrc", "_gvimrc",
    ]),
    ("webidl", &["*.idl", "*.webidl", "*.widl"]),
    ("wiki", &["*.mediawiki", "*.wiki"]),
    ("xml", &[
        "*.xml", "*.xml.dist", "*.dtd", "*.xsl", "*.xslt", "*.xsd", "*.xjb",
        "*.rng", "*.sch", "*.xhtml",
    ]),
    ("xz", &["*.xz", "*.txz"]),
    ("yacc", &["*.y"]),
    ("yaml", &["*.yaml", "*.yml"]),
    ("yang", &["*.yang"]),
    ("z", &["*.Z"]),
    ("zig", &["*.zig"]),
    ("zsh", &[
        ".zshenv", "zshenv",
        ".zlogin", "zlogin",
        ".zlogout", "zlogout",
        ".zprofile", "zprofile",
        ".zshrc", "zshrc",
        "*.zsh",
    ]),
    ("zstd", &["*.zst", "*.zstd"]),
];

#[cfg(test)]
mod tests {
    use super::DEFAULT_TYPES;

    #[test]
    fn default_types_are_sorted() {
        let mut names = DEFAULT_TYPES.iter().map(|(name, _exts)| name);

        let Some(mut previous_name) = names.next() else { return; };

        for name in names {
            assert!(
                name > previous_name,
                r#""{}" should be sorted before "{}" in `DEFAULT_TYPES`"#,
                name,
                previous_name
            );

            previous_name = name;
        }
    }
}
Repository: BurntSushi/ripgrep
File: crates/ignore/src/default_types.rs (Rust)

Code before:
    ("xml", &[
        "*.xml", "*.xml.dist", "*.dtd", "*.xsl", "*.xslt", "*.xsd", "*.xjb",
        "*.rng", "*.sch", "*.xhtml",
    ]),
    ("xz", &["*.xz", "*.txz"]),
    ("yacc", &["*.y"]),
    ("yaml", &["*.yaml", "*.yml"]),
    ("yang", &["*.yang"]),
    ("z", &["*.Z"]),
    ("zig", &["*.zig"]),
    ("zsh", &[
        ".zshenv", "zshenv",
        ".zlogin", "zlogin",
        ".zlogout", "zlogout",
        ".zprofile", "zprofile",
        ".zshrc", "zshrc",
        "*.zsh",
    ]),
    ("zstd", &["*.zst", "*.zstd"]),
];

#[test]
fn test_default_types_are_sorted() {
    let mut names = DEFAULT_TYPES.iter().map(|(name, _exts)| name);

    if let Some(first) = names.next() {
        let mut previous_name = first;
        for name in names {
            assert!(
                name > previous_name,
                r#""{}" should be sorted before "{}" in `DEFAULT_TYPES`"#,
                name,
                previous_name
            );

            previous_name = name;
        }
    }
}


Review comment (suggestion):
I would write this as:

```rust
let first = match names.next() {
    None => return,
    Some(first) => first,
};
```

Or perhaps even better, using the [newly stabilized `let else`](https://github.com/rust-lang/rust/pull/93628/):

```rust
let Some(first) = names.next() else { return };
```

Although in order to use `let else` we need to bump MSRV to Rust 1.65. Since ripgrep tracks the latest stable release of Rust, I have no problem with that. Indeed, [I just pushed a commit to do so](https://github.com/BurntSushi/ripgrep/commit/8905d54a9f25f4c1e4e3ca8331f517473e174d87), so all you need to do to use `let else` is to rebase on master.

Code after:
    ("wiki", &["*.mediawiki", "*.wiki"]),
    ("xml", &[
        "*.xml", "*.xml.dist", "*.dtd", "*.xsl", "*.xslt", "*.xsd", "*.xjb",
        "*.rng", "*.sch", "*.xhtml",
    ]),
    ("xz", &["*.xz", "*.txz"]),
    ("yacc", &["*.y"]),
    ("yaml", &["*.yaml", "*.yml"]),
    ("yang", &["*.yang"]),
    ("z", &["*.Z"]),
    ("zig", &["*.zig"]),
    ("zsh", &[
        ".zshenv", "zshenv",
        ".zlogin", "zlogin",
        ".zlogout", "zlogout",
        ".zprofile", "zprofile",
        ".zshrc", "zshrc",
        "*.zsh",
    ]),
    ("zstd", &["*.zst", "*.zstd"]),
];

#[cfg(test)]
mod tests {
    use super::DEFAULT_TYPES;

    #[test]
    fn default_types_are_sorted() {
        let mut names = DEFAULT_TYPES.iter().map(|(name, _exts)| name);

        let Some(mut previous_name) = names.next() else { return; };

        for name in names {
            assert!(
                name > previous_name,
                r#""{}" should be sorted before "{}" in `DEFAULT_TYPES`"#,
                name,
                previous_name
            );

            previous_name = name;
        }
    }
}
Repository: DioxusLabs/dioxus
File: packages/signals/tests/memo.rs (Rust)

Code before:
#![allow(unused, non_upper_case_globals, non_snake_case)]
use dioxus_core::NoOpMutations;
use std::collections::HashMap;
use std::rc::Rc;

use dioxus::html::p;
use dioxus::prelude::*;
use dioxus_core::ElementId;
use dioxus_signals::*;
use std::cell::RefCell;

#[test]
fn memos_rerun() {
    let _ = simple_logger::SimpleLogger::new().init();

    #[derive(Default)]
    struct RunCounter {
        component: usize,
        effect: usize,
    }

    let counter = Rc::new(RefCell::new(RunCounter::default()));
    let mut dom = VirtualDom::new_with_props(
        |counter: Rc<RefCell<RunCounter>>| {
            counter.borrow_mut().component += 1;

            let mut signal = use_signal(|| 0);
            let memo = use_memo({
                to_owned![counter];
                move || {

Review comment (suggestion):
```suggestion
use std::sync::atomic::{AtomicBool, Ordering};
```

Code after:
#![allow(unused, non_upper_case_globals, non_snake_case)]
use dioxus::html::p;
use dioxus::prelude::*;
use dioxus_core::ElementId;
use dioxus_core::NoOpMutations;
use dioxus_signals::*;
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use std::sync::atomic::{AtomicBool, Ordering};

#[test]
fn memos_rerun() {
    let _ = simple_logger::SimpleLogger::new().init();

    #[derive(Default)]
    struct RunCounter {
        component: usize,
        effect: usize,
    }

    let counter = Rc::new(RefCell::new(RunCounter::default()));
    let mut dom = VirtualDom::new_with_props(
        |counter: Rc<RefCell<RunCounter>>| {
            counter.borrow_mut().component += 1;

            let mut signal = use_signal(|| 0);
            let memo = use_memo({
                to_owned![counter];
                move || {