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

Add is_empty() for Path and OsStr #31231

Closed
wants to merge 1 commit into from
Closed

Conversation

frewsxcv
Copy link
Member

Related to #30259

Rebase of #30623

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@frewsxcv frewsxcv force-pushed the is_empty branch 4 times, most recently from 85738ba to 0dfe25d Compare January 27, 2016 01:55
@frewsxcv frewsxcv changed the title Add is_empty() for PathBuf Add is_empty() for Path Jan 27, 2016
@frewsxcv frewsxcv changed the title Add is_empty() for Path Add is_empty() for Path and OsStr Jan 27, 2016
@@ -277,6 +277,12 @@ impl OsStr {
self.to_bytes().and_then(|b| CString::new(b).ok())
}

/// Checks if the string is empty.
#[unstable(feature = "os_extras", reason = "recently added", issue = "30259")]
Copy link
Member

Choose a reason for hiding this comment

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

Should decide between keeping #30259 as a tracking issue for this unstable feature or closing it (i.e. the “Fixes” line on the PR). I’d rather repurpose the issue in question to be a tracking issue.

Also, perhaps a more self-explanatory feature name would be better? Something like osstr_is_empty?

@alexcrichton
Copy link
Member

Thanks @frewsxcv! I'm tagging with T-libs to ensure this comes up during triage.

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Jan 27, 2016
@@ -243,6 +244,7 @@
#![feature(on_unimplemented)]
#![feature(oom)]
#![feature(optin_builtin_traits)]
#![feature(os_extras)]
Copy link
Member

Choose a reason for hiding this comment

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

Were these necessary? I thought that intra-crate usage of unstable features didn't require these annotations...

@frewsxcv
Copy link
Member Author

Comments have been addressed

@eefriedman
Copy link
Contributor

See also #29453?

@alexcrichton
Copy link
Member

The libs team discussed this during triage today (sorry for taking awhile to get around to this @frewsxcv!), and we're definitely ok with this, especially in light of #29453.

@frewsxcv that issue is actually tracking an RFC which broadens the methods added here to others like len and with_capacity, out of curiosity, would you be up for implementing those as well? If not that's ok and I'll just go ahead and send this to bors!

@frewsxcv
Copy link
Member Author

Sure! I'll make those changes

@alexcrichton
Copy link
Member

Ok, cool, thanks! The full RFC is here, and feel free to ping me if you have any questions!

@frewsxcv
Copy link
Member Author

Opened a new PR that covers OsString and OsStr: #31608

@alexcrichton
Copy link
Member

Thanks @frewsxcv! I'm gonna close this in favor of that.

@frewsxcv
Copy link
Member Author

@alexcrichton Should there be a RFC opened for Path::is_empty?

@frewsxcv
Copy link
Member Author

Opened an issue there: rust-lang/rfcs#1497

@alexcrichton
Copy link
Member

Oh right, forgot about that! An RFC issue sounds good to me, though, thanks!

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Feb 25, 2016
Original issue requesting this feature:
rust-lang#30259

Originally implemented in rust-lang#30623
but that pull request when stale.

It was rebased in rust-lang#31231, but the
`Path` changes got lost as the focus shifted towards `OsString` and
`OsStr`.

An RFC (rust-lang/rfcs#1497) was briefly
opened, since I didn't know if this functionality needed an RFC, but
@alexcrichton clarified in the RFC issue I linked that this is not the
case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants