mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 06:18:21 +02:00
Deref &String
arguments to &str
where appropriate (#10321)
# Description This generally makes for nicer APIs, as you are not forced to use an existing allocation covering the full `String`. Some exceptions remain where the underlying type requirements favor it. # User-Facing Changes None
This commit is contained in:
committed by
GitHub
parent
e90b099622
commit
6e9b6f22c9
@ -116,9 +116,8 @@ pub fn evaluate_file(
|
||||
if block.signature.name == "main" {
|
||||
block.signature.name = source_filename.to_string_lossy().to_string();
|
||||
} else if block.signature.name.starts_with("main ") {
|
||||
block.signature.name = source_filename.to_string_lossy().to_string()
|
||||
+ " "
|
||||
+ &String::from_utf8_lossy(&block.signature.name.as_bytes()[5..]);
|
||||
block.signature.name =
|
||||
source_filename.to_string_lossy().to_string() + " " + &block.signature.name[5..];
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user