Skip to content

Deref #56

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

Merged
merged 3 commits into from
Feb 2, 2016
Merged

Deref #56

merged 3 commits into from
Feb 2, 2016

Conversation

pocket7878
Copy link
Contributor

No description provided.

@pocket7878 pocket7878 changed the title [WIP] Deref Deref Feb 2, 2016
@pocket7878
Copy link
Contributor Author

添削宜しくお願い致します. @KeenS

値の前にアンパサンド(&)をつけることによってその値への参照を取得することができます。
故に `owned` は `String` に、 `&owned` は `&String` になります。
そして、 `String` が `Deref<Target=str>` を実装しているために、
`&String` は `foo()` が要求している `&str` に型強制されます。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これはただ事実を述べていると思います。なので、

「なので、 ownedString であり、 &owned&String であり、 そしてStringDeref<Target=str> を実装しているために、 &Stringfoo() が要求している &str に型強制されます。」
はどうでしょう。

@KeenS
Copy link
Member

KeenS commented Feb 2, 2016

1点だけコメントしました。いかがでしょう。

@pocket7878
Copy link
Contributor Author

@KeenS ありがとうございます。反映いたしました。

@KeenS
Copy link
Member

KeenS commented Feb 2, 2016

確認しました。お疲れ様です。

KeenS added a commit that referenced this pull request Feb 2, 2016
@KeenS KeenS merged commit 72dfe72 into rust-lang-ja:master Feb 2, 2016
@tatsuya6502 tatsuya6502 modified the milestone: 1.6 Apr 28, 2016
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