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

fix(using_as): Add test so that proper type is returned. #512

Merged
merged 2 commits into from
Sep 7, 2020

Conversation

ryanpcmcquen
Copy link
Contributor

It was pretty easy (at least for me), to get this to compile but return an incorrect value. I've added a test to ensure the proper type is used.

Using a usize cast:
Screen Shot 2020-08-31 at 12 54 02 PM

Using f64:
Screen Shot 2020-08-31 at 12 53 41 PM

Seems like the test is helpful to avoid that.

@ryanpcmcquen ryanpcmcquen changed the title Add test for using as so that proper type is returned. Add test for using_as so that proper type is returned. Aug 31, 2020
@AbdouSeck AbdouSeck self-assigned this Sep 7, 2020
@AbdouSeck
Copy link
Contributor

Hi @ryanpcmcquen thanks for this PR. This is very much needed for the exercise!

@fmoko, should be good to go.

Best,
Abdou

@shadows-withal shadows-withal changed the title Add test for using_as so that proper type is returned. fix(using_as): Add test so that proper type is returned. Sep 7, 2020
@shadows-withal shadows-withal merged commit 3286c5e into rust-lang:main Sep 7, 2020
OnunPereira pushed a commit to OnunPereira/rustlings that referenced this pull request Sep 30, 2020
palako pushed a commit to palako/rustlings that referenced this pull request Nov 8, 2020
JuniousY pushed a commit to JuniousY/rustlings that referenced this pull request Jan 28, 2021
noiffion pushed a commit to noiffion/rustlings that referenced this pull request Aug 20, 2021
bugaolengdeyuxiaoer pushed a commit to bugaolengdeyuxiaoer/rustlings that referenced this pull request Dec 28, 2021
ppp3 pushed a commit to ppp3/rustlings that referenced this pull request May 23, 2022
dmoore04 pushed a commit to dmoore04/rustlings that referenced this pull request Sep 11, 2022
Spacebody pushed a commit to Spacebody/my-rustlings that referenced this pull request Nov 18, 2022
lziegler pushed a commit to lziegler/rustlings that referenced this pull request Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants