resolve TODO: don't use vec

This commit is contained in:
shua 2024-06-23 16:19:30 +02:00
parent 794c20956d
commit 4d0112ef2a
No known key found for this signature in database
GPG key ID: 73387DA37055770F

View file

@ -981,20 +981,14 @@ fn link_linux(
LinkType::Executable => (
// Presumably this S stands for Static, since if we include Scrt1.o
// in the linking for dynamic builds, linking fails.
vec![scrt1_path_str.to_string()],
[scrt1_path_str.as_ref()],
output_path,
),
LinkType::Dylib => {
let mut output_path = output_path;
output_path.set_extension("so");
(
// TODO: find a way to avoid using a vec! here - should theoretically be
// able to do this somehow using &[] but the borrow checker isn't having it.
// Also find a way to have these be string slices instead of Strings.
vec!["-shared".to_string()],
output_path,
)
(["-shared"], output_path)
}
LinkType::None => internal_error!("link_linux should not be called with link type of none"),
};