Skip to content
Merged
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/bun_core/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub use string::{
string_joiner, write, zig_string,
};
pub use string::{
HashedString, MutableString, NodeEncoding, OwnedString, OwnedStringCell, PathString,
HashedString, MutableString, NodeEncoding, OwnedString, OwnedStringCell,
SliceWithUnderlyingString, SmolStr, String, StringBuilder, WTFStringImpl, WTFStringImplExt,
WTFStringImplStruct, ZigString, ZigStringSlice,
};
Expand Down
190 changes: 0 additions & 190 deletions src/bun_core/string/PathString.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/bun_core/string/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ pub use crate::{exact_case, literal, to_utf16_literal, w};
pub mod escape_reg_exp;
#[path = "HashedString.rs"]
pub mod hashed_string;
#[path = "PathString.rs"]
pub mod path_string;
#[path = "SmolStr.rs"]
pub mod smol_str;
#[path = "StringBuilder.rs"]
Expand Down Expand Up @@ -2309,7 +2307,6 @@ pub use crate::StringPointer;

pub use hashed_string::HashedString;
pub use mutable_string::MutableString;
pub use path_string::PathString;
pub use smol_str::SmolStr;
pub use string_builder::StringBuilder;

Expand Down
16 changes: 8 additions & 8 deletions src/bundler/LinkerGraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bun_ast::server_component_boundary;
use bun_ast::symbol;
use bun_ast::{DeclaredSymbol, DeclaredSymbolList, Dependency, Symbol};
use bun_collections::{AutoBitSet, DynamicBitSetUnmanaged as BitSet, MultiArrayList, VecExt};
use bun_core::PathString;
use bun_core::RawSlice;

use crate::IndexStringMap::IndexStringMap;
use crate::{ImportTracker, Index, JSAst, Part, Ref, UseDirective, import_record, index, part};
Expand All @@ -20,11 +20,11 @@ bun_core::declare_scope!(LinkerGraph, visible);

pub mod entry_point {
use bun_collections::MultiArrayList;
use bun_core::PathString;
use bun_core::RawSlice;

#[derive(Default)]
pub struct EntryPoint {
pub output_path: PathString,
pub output_path: RawSlice<u8>,
pub source_index: crate::IndexInt,
pub output_path_was_auto_generated: bool,
}
Expand All @@ -33,7 +33,7 @@ pub mod entry_point {

bun_collections::multi_array_columns! {
pub trait EntryPointColumns for EntryPoint {
output_path: PathString,
output_path: RawSlice<u8>,
source_index: crate::IndexInt,
output_path_was_auto_generated: bool,
}
Expand Down Expand Up @@ -700,7 +700,7 @@ impl<'a> LinkerGraph<'a> {
let mut ep_slice = self.entry_points.slice();
let ep_cols = ep_slice.split_mut();
let source_indices: &mut [index::Int] = ep_cols.source_index;
let path_strings: &mut [PathString] = ep_cols.output_path;
let path_strings: &mut [RawSlice<u8>] = ep_cols.output_path;
ep_cols.output_path_was_auto_generated.fill(false);

debug_assert_eq!(entry_points.len(), path_strings.len());
Expand All @@ -718,9 +718,9 @@ impl<'a> LinkerGraph<'a> {

// Check if this entry point has an original name (from virtual entry resolution)
if let Some(original_name) = entry_point_original_names.get(i.get()) {
*path_string = PathString::init(original_name);
*path_string = RawSlice::new(original_name);
} else {
*path_string = PathString::init(source.path.text);
*path_string = RawSlice::new(source.path.text);
}

*source_index = source.index.0;
Expand All @@ -739,7 +739,7 @@ impl<'a> LinkerGraph<'a> {

self.entry_points.append_assume_capacity(EntryPoint {
source_index: id,
output_path: PathString::init(source.path.text),
output_path: RawSlice::new(source.path.text),
output_path_was_auto_generated: true,
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/bundler/OutputFile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::options::Loader;
// the `options` module already defines them locally.
use crate::options::{OutputKind, Side};
use bun_core::Error;
use bun_core::{PathString, String as BunString};
use bun_core::String as BunString;
use bun_paths::PathBuffer;
use bun_paths::fs;
use bun_paths::resolve_path::{self, platform};
Expand Down Expand Up @@ -478,7 +478,7 @@ impl OutputFile {
encoding: bun_sys::WriteFileEncoding::Buffer,
mode: if self.is_executable { 0o755 } else { 0o644 },
dirfd: root_dir,
file: bun_sys::PathOrFileDescriptor::Path(PathString::init(rel_path)),
file: bun_sys::PathOrFileDescriptor::Path(rel_path),
},
)?;
}
Expand Down
8 changes: 4 additions & 4 deletions src/bundler/linker_context/writeOutputFilesToDisk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bun_alloc::MaxHeapAllocator;
use bun_ast::Loc;
use bun_core::fmt::quote;
use bun_core::{Error, err};
use bun_core::{PathString, String as BunString, immutable as strings};
use bun_core::{String as BunString, immutable as strings};
use bun_paths::{self as paths, PathBuffer};
use bun_wyhash::hash;

Expand Down Expand Up @@ -371,9 +371,9 @@ pub fn write_output_files_to_disk(
0o644
},
dirfd: bun_sys::Fd::from_std_dir(&root_dir),
file: PathOrFileDescriptor::Path(PathString::init(
file: PathOrFileDescriptor::Path(
&fdpath[..frp.len() + BYTECODE_EXTENSION.len()],
)),
),
},
) {
Ok(_) => {}
Expand Down Expand Up @@ -444,7 +444,7 @@ pub fn write_output_files_to_disk(
0o644
},
dirfd: bun_sys::Fd::from_std_dir(&root_dir),
file: PathOrFileDescriptor::Path(PathString::init(&chunk.final_rel_path)),
file: PathOrFileDescriptor::Path(&chunk.final_rel_path),
},
) {
Err(e) => {
Expand Down
4 changes: 2 additions & 2 deletions src/io/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2008,8 +2008,8 @@ impl FilePollRef {

/// Moved from `bun_runtime::webcore::PathOrFileDescriptor`.
/// Owned here so `open_for_writing` has no upward dep; runtime re-exports it.
pub enum PathOrFileDescriptor {
Path(bun_core::PathString),
pub enum PathOrFileDescriptor<'a> {
Path(&'a [u8]),
Fd(Fd),
}

Expand Down
4 changes: 2 additions & 2 deletions src/io/openForWriting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub trait OpenForWritingInput {
) -> bun_sys::Result<Fd>;
}

impl OpenForWritingInput for crate::PathOrFileDescriptor {
impl OpenForWritingInput for crate::PathOrFileDescriptor<'_> {
fn open_for_writing_result(
&self,
dir: Fd,
Expand All @@ -32,7 +32,7 @@ impl OpenForWritingInput for crate::PathOrFileDescriptor {
match self {
Path(path) => {
*is_nonblocking = true;
bun_sys::openat_a(dir, path.slice(), input_flags, mode)
bun_sys::openat_a(dir, path, input_flags, mode)
}
Fd(fd_) => bun_sys::dup_with_flags(*fd_, 0),
}
Expand Down
Loading
Loading