Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libstd/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<T> Option<T> {

/// Returns `None` if the option is `None`, otherwise returns `optb`.
#[inline]
pub fn and(self, optb: Option<T>) -> Option<T> {
pub fn and(self, optb: Option<U>) -> Option<U> {
Copy link
Member

Choose a reason for hiding this comment

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

I think this will fail to compile because of the undeclared U type parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, you're right. It needs to be and<U>.

match self {
Some(_) => optb,
None => None,
Expand Down