Add $CARGO_PKG_AUTHORZ that separates the entries with \x01 instead of :#15474
Closed
nabijaczleweli wants to merge 1 commit into
Closed
Add $CARGO_PKG_AUTHORZ that separates the entries with \x01 instead of :#15474nabijaczleweli wants to merge 1 commit into
nabijaczleweli wants to merge 1 commit into
Conversation
Valid and reasonable authors entries like
authors = ["наб <nabijaczleweli@nabijaczleweli.xyz>",
"nevsal",
"Lynnesbian <https://fedi.lynnesbian.space/@lynnesbian>"]
become
наб <nabijaczleweli@nabijaczleweli.xyz>
nevsal
Lynnesbian <https
//fedi.lynnesbian.space/@Lynnesbian>
with the standard .replace(':', "\n") treatment.
There's no reason to use : instead of something that's guaranteed to
never be in the string. \0 is unusable, so use \1:
$ cat src/main.rs
#[macro_use]
extern crate clap;
fn main() {
println!("{}", env!("CARGO_PKG_AUTHORS"));
println!("{}", env!("CARGO_PKG_AUTHORZ"));
println!("{}", crate_authors!("\n"));
println!("{}", env!("CARGO_PKG_AUTHORZ").replace('\x01', "\n"));
}
$ cat Cargo.toml
[package]
name = "b"
version = "0.1.0"
authors = ["наб <nabijaczleweli@nabijaczleweli.xyz>",
"nevsal",
"Lynnesbian <https://fedi.lynnesbian.space/@lynnesbian>"]
[dependencies.clap]
version = "3.2"
features = ["cargo"]
$ ../cargo/target/debug/cargo run
наб <nabijaczleweli@nabijaczleweli.xyz>:nevsal:Lynnesbian <https://fedi.lynnesbian.space/@lynnesbian>
наб <nabijaczleweli@nabijaczleweli.xyz>nevsalLynnesbian <https://fedi.lynnesbian.space/@lynnesbian>
наб <nabijaczleweli@nabijaczleweli.xyz>
nevsal
Lynnesbian <https
//fedi.lynnesbian.space/@Lynnesbian>
наб <nabijaczleweli@nabijaczleweli.xyz>
nevsal
Lynnesbian <https://fedi.lynnesbian.space/@lynnesbian>
$ ../cargo/target/debug/cargo run | cat -A
warning: no edition set: defaulting to the 2015 edition while the latest is 2024
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.21s
Running `target/debug/b`
M-PM-=M-PM-0M-PM-1 <nabijaczleweli@nabijaczleweli.xyz>:nevsal:Lynnesbian <https://fedi.lynnesbian.space/@lynnesbian>$
M-PM-=M-PM-0M-PM-1 <nabijaczleweli@nabijaczleweli.xyz>^Anevsal^ALynnesbian <https://fedi.lynnesbian.space/@lynnesbian>$
M-PM-=M-PM-0M-PM-1 <nabijaczleweli@nabijaczleweli.xyz>$
nevsal$
Lynnesbian <https$
//fedi.lynnesbian.space/@Lynnesbian>$
M-PM-=M-PM-0M-PM-1 <nabijaczleweli@nabijaczleweli.xyz>$
nevsal$
Lynnesbian <https://fedi.lynnesbian.space/@lynnesbian>$
Ref: nabijaczleweli/cargo-update#294
Collaborator
|
r? @weihanglo rustbot has assigned @weihanglo. Use |
Contributor
|
Note that the In light of that, I would be inclined to not add new features to better support this (in fact existing feature requests helped raised the visibility for the deprecation discussion). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
Valid and reasonable authors entries like
become
with the standard
.replace(':', "\n")treatment.There's no reason to use
:instead of something that's guaranteed to never be in the string.\0is unusable, so use\1.How should we test and review this PR?
Additional information
Downstream report: nabijaczleweli/cargo-update#294