Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature/generics3 updt from old pr#2043

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
poneciak57 wants to merge5 commits intorust-lang:main
base:main
Choose a base branch
Loading
fromponeciak57:feature/generics3_updt_from_old_pr

Conversation

@poneciak57
Copy link
Contributor

Created a new pull request based on the previous one (#1470).

Added a new generic exercise that focuses on function reusability using generics.

@poneciak57
Copy link
ContributorAuthor

poneciak57 commentedJul 11, 2024
edited
Loading

One of the checks failedRustlings Tests / dev-check (pull_request)
It told me to run commandcargo run -- dev update but this failed should i open an issue or should i just update this file manually ?

windows 11
rustup 1.27.1
cargo 1.79.0
Error message:

cargo run -- dev update    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s     Running `target\debug\rustlings.exe dev update`Error: Failed to update the file `dev/Cargo.toml`Caused by:    Failed to find the start of the `bin` list (`bin = [`)error: process didn't exit successfully: `target\debug\rustlings.exe dev update` (exit code: 1)

@mo8it
Copy link
Contributor

I can take care of the CI test later. Probably a Windows issue.

We shouldn't use traits / trait bounds because the exercises about them are after the generics exercises.

How about a function taking&[Option<T>] and returningVec<T> containing only theSome values?

@poneciak57
Copy link
ContributorAuthor

I changedstringify to this:

fninto_dispose_nulls<T>(list:Vec<Option<T>>) ->Vec<T>{    list.into_iter().flatten().collect()}

i tried to have&[Option<T>] as an argument but it requiresT to implementClone (and i couldn't find any suitable workaround)

@mo8it
Copy link
Contributor

i tried to have &[Option] as an argument but it requires T to implement Clone (and i couldn't find any suitable workaround)

Oh, yeah. We would need to return something likeVec<&T> otherwise. But this is fine how you did it withVec as argument.

@mo8itmo8it added this to thev7 milestoneJul 12, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@kh3rldkh3rldkh3rld approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

v7

Development

Successfully merging this pull request may close these issues.

3 participants

@poneciak57@mo8it@kh3rld

[8]ページ先頭

©2009-2025 Movatter.jp