chore: update rust version
This commit is contained in:
@@ -11,4 +11,8 @@ resolver = "2"
|
||||
|
||||
[profile.release]
|
||||
debug = 0
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
opt-level = "z"
|
||||
panic = "abort"
|
||||
|
||||
|
||||
@@ -17,6 +17,3 @@ mimalloc = { version = "0.1.25", default-features = false }
|
||||
|
||||
[build-dependencies]
|
||||
napi-build = { version = "2" }
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
|
||||
@@ -112,7 +112,7 @@ pub struct TransformModulesOptions {
|
||||
pub fn transform_fs(config: TransformFsOptions) -> Result<TransformOutput, Error> {
|
||||
let core_module = config
|
||||
.core_module
|
||||
.map_or(BUILDER_IO_QWIK.clone(), |s| s.into());
|
||||
.map_or_else(|| BUILDER_IO_QWIK.clone(), |s| s.into());
|
||||
let src_dir = Path::new(&config.src_dir);
|
||||
let root_dir = config.root_dir.as_ref().map(Path::new);
|
||||
|
||||
@@ -166,7 +166,7 @@ pub fn transform_fs(config: TransformFsOptions) -> Result<TransformOutput, Error
|
||||
pub fn transform_modules(config: TransformModulesOptions) -> Result<TransformOutput, Error> {
|
||||
let core_module = config
|
||||
.core_module
|
||||
.map_or(BUILDER_IO_QWIK.clone(), |s| s.into());
|
||||
.map_or_else(|| BUILDER_IO_QWIK.clone(), |s| s.into());
|
||||
let src_dir = std::path::Path::new(&config.src_dir);
|
||||
let root_dir = config.root_dir.as_ref().map(Path::new);
|
||||
|
||||
|
||||
@@ -748,7 +748,7 @@ pub fn parse_path(src: &str, base_dir: &Path) -> Result<PathData, Error> {
|
||||
}
|
||||
|
||||
pub fn normalize_path<P: AsRef<Path>>(path: P) -> PathBuf {
|
||||
let ends_with_slash = path.as_ref().to_str().map_or(false, |s| s.ends_with('/'));
|
||||
let ends_with_slash = path.as_ref().to_str().is_some_and(|s| s.ends_with('/'));
|
||||
let mut normalized = PathBuf::new();
|
||||
for component in path.as_ref().components() {
|
||||
match &component {
|
||||
|
||||
@@ -314,7 +314,7 @@ impl<'a> QwikTransform<'a> {
|
||||
}
|
||||
display_name = escape_sym(&display_name);
|
||||
let first_char = display_name.chars().next();
|
||||
if first_char.map_or(false, |c| c.is_ascii_digit()) {
|
||||
if first_char.is_some_and(|c| c.is_ascii_digit()) {
|
||||
display_name = format!("_{}", display_name);
|
||||
}
|
||||
let index = match self.segment_names.get_mut(&display_name) {
|
||||
@@ -1832,11 +1832,12 @@ impl<'a> Fold for QwikTransform<'a> {
|
||||
}
|
||||
|
||||
fn fold_var_declarator(&mut self, node: ast::VarDeclarator) -> ast::VarDeclarator {
|
||||
let mut stacked = false;
|
||||
if let ast::Pat::Ident(ref ident) = node.name {
|
||||
let stacked = if let ast::Pat::Ident(ref ident) = node.name {
|
||||
self.stack_ctxt.push(ident.id.sym.to_string());
|
||||
stacked = true;
|
||||
}
|
||||
true
|
||||
} else {
|
||||
false
|
||||
};
|
||||
let o = node.fold_children_with(self);
|
||||
if stacked {
|
||||
self.stack_ctxt.pop();
|
||||
@@ -2076,12 +2077,12 @@ impl<'a> Fold for QwikTransform<'a> {
|
||||
}
|
||||
|
||||
fn fold_jsx_element(&mut self, node: ast::JSXElement) -> ast::JSXElement {
|
||||
let mut stacked = false;
|
||||
|
||||
if let ast::JSXElementName::Ident(ref ident) = node.opening.name {
|
||||
let stacked = if let ast::JSXElementName::Ident(ref ident) = node.opening.name {
|
||||
self.stack_ctxt.push(ident.sym.to_string());
|
||||
stacked = true;
|
||||
}
|
||||
true
|
||||
} else {
|
||||
false
|
||||
};
|
||||
let o = node.fold_children_with(self);
|
||||
if stacked {
|
||||
self.stack_ctxt.pop();
|
||||
@@ -2373,7 +2374,7 @@ fn compute_scoped_idents(all_idents: &[Id], all_decl: &[IdPlusType]) -> (Vec<Id>
|
||||
}
|
||||
|
||||
fn get_canonical_filename(display_name: &JsWord, symbol_name: &JsWord) -> JsWord {
|
||||
let hash = symbol_name.split('_').last().unwrap();
|
||||
let hash = symbol_name.split('_').next_back().unwrap();
|
||||
JsWord::from(format!("{}_{}", display_name, hash))
|
||||
}
|
||||
|
||||
|
||||
@@ -69,10 +69,3 @@ pub enum DiagnosticCategory {
|
||||
pub enum DiagnosticScope {
|
||||
Optimizer,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Debug, Deserialize, Eq, PartialEq, Clone, Copy)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum SourceType {
|
||||
Script,
|
||||
Module,
|
||||
}
|
||||
|
||||
@@ -25,10 +25,3 @@ getrandom = { version = "0.2", features = ["js"] }
|
||||
|
||||
[package.metadata.wasm-pack.profile.release]
|
||||
wasm-opt = false
|
||||
|
||||
[profile.release]
|
||||
debug = 0
|
||||
lto=true
|
||||
codegen-units=1
|
||||
opt-level="z"
|
||||
panic="abort"
|
||||
|
||||
@@ -1 +1 @@
|
||||
nightly-2024-10-01
|
||||
nightly-2025-10-01
|
||||
|
||||
Reference in New Issue
Block a user