Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep only needed unwrap statements #255

Closed
tdejager opened this issue Nov 2, 2023 · 3 comments · Fixed by #370
Closed

Keep only needed unwrap statements #255

tdejager opened this issue Nov 2, 2023 · 3 comments · Fixed by #370
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tdejager
Copy link
Contributor

tdejager commented Nov 2, 2023

While looking through the code I've noticed a whole bunch of unwrap statements. Would be good to get a close look into which of these could be replaced.

See:

$ rg unwrap -c

src/used_variables.rs:3
src/windows/link.rs:1
src/main.rs:10
src/windows/env.rs:2
src/recipe.rs:3
src/packaging.rs:11
src/post.rs:3
src/index.rs:25
src/variant_config.rs:14
src/unix/env.rs:2
src/linux/link.rs:1
src/linux/env.rs:8
src/metadata.rs:2
src/render/pin.rs:15
src/render/resolved_dependencies.rs:5
src/recipe/parser.rs:3
src/source/url_source.rs:6
src/recipe/stage1.rs:5
src/recipe/jinja.rs:3
src/recipe/error.rs:3
src/render/solver.rs:13
src/recipe/parser/build.rs:3
src/recipe/parser/about.rs:2
src/source/git_source.rs:13
src/source/mod.rs:16
src/recipe/parser/package.rs:2
src/macos/link.rs:1
src/recipe/parser/source.rs:1
src/test.rs:20
src/selectors.rs:19
src/env_vars.rs:7
@tdejager tdejager added enhancement New feature or request good first issue Good for newcomers labels Nov 2, 2023
@swarnimarun
Copy link
Contributor

I have reviewed most of the code as well recently, can say largely most of it can be removed, some more easily than others, perhaps anyone making a PR consider doing it one file at a time.

@wolfv
Copy link
Member

wolfv commented Nov 2, 2023

I am also happy to take on some of these, maybe during the next train ride or so. Will ping here which files I am tackling to avoid double work.

@wolfv wolfv mentioned this issue Nov 2, 2023
@wolfv
Copy link
Member

wolfv commented Nov 2, 2023

I cleaned a few. Just to note, some are also unwrap_or_default and similar (you might want to use unwrap() as search).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants