-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 error message for WindowsPath::new #16443
Conversation
/// | ||
/// # Example | ||
/// | ||
/// ```{rust,ignore} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ignore
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we can't guarantee this path exists, right?
though, I guess, in this situation, it won't fail
. haha 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Path
is an abstract object, it doesn't need to represent the actual file system (unless you call a function like is_dir()
or whatever on it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes total sense, it was just my brain being silly.
This has been updated to just improve style. r? |
#[inline] | ||
pub fn new<T: BytesContainer>(path: T) -> Path { | ||
GenericPath::new(path) | ||
} | ||
|
||
/// Returns a new Path from a byte vector or string, if possible | ||
/// Returns a new `Some(Path)` from a `BytesContainer`. Returns `None` if the vector contains a | ||
/// null byte, or if it contains invalid UTF-8. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a rather long summary line. I would suggest breaking the two sentences apart and using only the first as the summary. When a summary says that it returns Some(...)
I think it's reasonable to expect that people will understand that the description explains the conditions under which it returns None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
Is there something wrong with the term "NUL"? That's the name of the character |
Also the commit message and PR title should probably be updated to say |
I was not familiar with |
Updated, @kballard |
@kballard bors thinks this is 'under discussion.' Any ideas? |
@steveklabnik Apparently I r+'d the copy of the commit in rust-lang/rust and not the copy in steveklabnik/rust. GitHub makes that easy to accidentally do, and doesn't make a distinction when showing the comments in the discussion, but bors cares. |
Noted! |
|
zomg, fixing |
edd627f
to
e918733
Compare
@kballard updated |
Originally discovered here: http://www.reddit.com/r/rust/comments/2dbg3j/hm_unwrap_is_being_renamed_to_assert/cjnxiax