-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking Issue for ASCII methods on OsStr #70516
Comments
Just needed |
Currently, SQLx contains env::var("SQLX_OFFLINE")
.map(|s| s.eq_ignore_ascii_case("true") || s == "1")
.unwrap_or(false) The UTF-8 check that is included in there, while not a problem in practice, seems pointless. Changing to |
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Slight question about pub fn eq_ignore_ascii_case<S: ?Sized + AsRef<OsStr>>(&self, other: &S) -> bool Is this supposed to be @rfcbot concern eq_ignore_ascii_case &S |
I think it should be. I'm not sure why I wrote it like I did originally, but this makes more sense to me. I can make that PR if needed. Or can it be done in the stabilization PR? Not sure what the process is from here. |
Per a comment on rust-lang#70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference. This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`. Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example. If this change should be made in some other PR (like rust-lang#80193) then please just close this.
OsStr eq_ignore_ascii_case takes arg by value Per a comment on rust-lang#70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference. This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`. Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example. If this change should be made in some other PR (like rust-lang#80193) then please just close this.
OsStr eq_ignore_ascii_case takes arg by value Per a comment on rust-lang#70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference. This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`. Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example. If this change should be made in some other PR (like rust-lang#80193) then please just close this.
OsStr eq_ignore_ascii_case takes arg by value Per a comment on rust-lang#70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference. This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`. Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example. If this change should be made in some other PR (like rust-lang#80193) then please just close this.
OsStr eq_ignore_ascii_case takes arg by value Per a comment on rust-lang#70516 this changes `eq_ignore_ascii_case` to take the generic parameter `S: AsRef<OsStr>` by value instead of by reference. This is technically a breaking change to an unstable method. I think the only way it would break is if you called this method with an explicit type parameter, ie `my_os_str.eq_ignore_ascii_case::<str>("foo")` becomes `my_os_str.eq_ignore_ascii_case::<&str>("foo")`. Besides that, I believe it is overall more flexible since it can now take an owned `OsString` for example. If this change should be made in some other PR (like rust-lang#80193) then please just close this.
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
@TyPR124 you can tick the FCP box, as the FCP is complete. |
…-ou-se stabilize `feature(osstring_ascii)` This PR stabilizes `feature(osstring_ascii)`. Fixes rust-lang#70516.
beta.4 introduced errors like these: error[E0658]: arbitrary expressions in key-value attributes are unstable --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10 | 8 | #![doc = include_str!("../README.md")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #78835 <rust-lang/rust#78835> for more information error[E0658]: use of unstable library feature 'osstring_ascii' --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/parse/matches/matched_arg.rs:130:19 | 130 | v.eq_ignore_ascii_case(val) | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #70516 <rust-lang/rust#70516> for more information
beta.4 introduced errors like these: error[E0658]: arbitrary expressions in key-value attributes are unstable --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10 | 8 | #![doc = include_str!("../README.md")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #78835 <rust-lang/rust#78835> for more information error[E0658]: use of unstable library feature 'osstring_ascii' --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/parse/matches/matched_arg.rs:130:19 | 130 | v.eq_ignore_ascii_case(val) | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #70516 <rust-lang/rust#70516> for more information
Avoids errors like this: error[E0658]: arbitrary expressions in key-value attributes are unstable --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10 | 8 | #![doc = include_str!("../README.md")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #78835 <rust-lang/rust#78835> for more information Compiling binread v2.1.1 Compiling logos v0.12.0 error[E0658]: use of unstable library feature 'osstring_ascii' --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/parse/matches/matched_arg.rs:130:19 | 130 | v.eq_ignore_ascii_case(val) | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #70516 <rust-lang/rust#70516> for more information
Avoids errors like this: error[E0658]: arbitrary expressions in key-value attributes are unstable --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10 | 8 | #![doc = include_str!("../README.md")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #78835 <rust-lang/rust#78835> for more information Compiling binread v2.1.1 Compiling logos v0.12.0 error[E0658]: use of unstable library feature 'osstring_ascii' --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/parse/matches/matched_arg.rs:130:19 | 130 | v.eq_ignore_ascii_case(val) | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #70516 <rust-lang/rust#70516> for more information
beta.4 introduced errors like these: error[E0658]: arbitrary expressions in key-value attributes are unstable --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10 | 8 | #![doc = include_str!("../README.md")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #78835 <rust-lang/rust#78835> for more information error[E0658]: use of unstable library feature 'osstring_ascii' --> /Users/ericswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/parse/matches/matched_arg.rs:130:19 | 130 | v.eq_ignore_ascii_case(val) | ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #70516 <rust-lang/rust#70516> for more information
Feature gate:
#![feature(osstring_ascii)]
Public API
Steps / History
&mut OsStr
OsStr
feature(osstring_ascii)
#80193 - Stabilization PRUnresolved Questions
The text was updated successfully, but these errors were encountered: