mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
lib: prefer replaceString over replaceStrings
This commit is contained in:
parent
b5720e2b3f
commit
b3b0fd266b
3 changed files with 5 additions and 5 deletions
|
@ -18,7 +18,7 @@ let
|
||||||
concatStrings
|
concatStrings
|
||||||
escape
|
escape
|
||||||
head
|
head
|
||||||
replaceStrings
|
replaceString
|
||||||
;
|
;
|
||||||
|
|
||||||
mkPrimitive = t: v: {
|
mkPrimitive = t: v: {
|
||||||
|
@ -451,7 +451,7 @@ rec {
|
||||||
mkString =
|
mkString =
|
||||||
v:
|
v:
|
||||||
let
|
let
|
||||||
sanitize = s: replaceStrings [ "\n" ] [ "\\n" ] (escape [ "'" "\\" ] s);
|
sanitize = s: replaceString "\n" "\\n" (escape [ "'" "\\" ] s);
|
||||||
in
|
in
|
||||||
mkPrimitive type.string v
|
mkPrimitive type.string v
|
||||||
// {
|
// {
|
||||||
|
|
|
@ -1173,7 +1173,7 @@ rec {
|
||||||
string = toString arg;
|
string = toString arg;
|
||||||
in
|
in
|
||||||
if match "[[:alnum:],._+:@%/-]+" string == null then
|
if match "[[:alnum:],._+:@%/-]+" string == null then
|
||||||
"'${replaceStrings [ "'" ] [ "'\\''" ] string}'"
|
"'${replaceString "'" "'\\''" string}'"
|
||||||
else
|
else
|
||||||
string;
|
string;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ let
|
||||||
optionalAttrs
|
optionalAttrs
|
||||||
optionalString
|
optionalString
|
||||||
removeSuffix
|
removeSuffix
|
||||||
replaceStrings
|
replaceString
|
||||||
toUpper
|
toUpper
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ let
|
||||||
#
|
#
|
||||||
# https://github.com/rust-lang/cargo/pull/9169
|
# https://github.com/rust-lang/cargo/pull/9169
|
||||||
# https://github.com/rust-lang/cargo/issues/8285#issuecomment-634202431
|
# https://github.com/rust-lang/cargo/issues/8285#issuecomment-634202431
|
||||||
cargoEnvVarTarget = replaceStrings [ "-" ] [ "_" ] (toUpper final.rust.cargoShortTarget);
|
cargoEnvVarTarget = replaceString "-" "_" (toUpper final.rust.cargoShortTarget);
|
||||||
|
|
||||||
# True if the target is no_std
|
# True if the target is no_std
|
||||||
# https://github.com/rust-lang/rust/blob/2e44c17c12cec45b6a682b1e53a04ac5b5fcc9d2/src/bootstrap/config.rs#L415-L421
|
# https://github.com/rust-lang/rust/blob/2e44c17c12cec45b6a682b1e53a04ac5b5fcc9d2/src/bootstrap/config.rs#L415-L421
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue