Skip to content

Commit

Permalink
build: Update rust toolchain version (#5161)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Roos <[email protected]>
  • Loading branch information
3 people authored Feb 25, 2025
1 parent b1e91e4 commit e393ab4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions prqlc/prqlc/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ fn insert_stmts_at_path(module: &mut pr::ModuleDef, mut path: Vec<String>, stmts
}

pub(crate) fn is_mod_def_for(stmt: &pr::Stmt, name: &str) -> bool {
stmt.kind.as_module_def().map_or(false, |x| x.name == name)
stmt.kind.as_module_def().is_some_and(|x| x.name == name)
}

fn path_starts_with_uppercase(p: &&PathBuf) -> bool {
p.components()
.next()
.and_then(|x| x.as_os_str().to_str())
.and_then(|x| x.chars().next())
.map_or(false, |x| x.is_uppercase())
.is_some_and(|x| x.is_uppercase())
}

pub fn os_path_to_prql_path(path: &Path) -> Result<Vec<String>> {
Expand Down
6 changes: 3 additions & 3 deletions prqlc/prqlc/src/semantic/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ impl Lowerer {

fn declare_as_columns(&mut self, exprs: pl::Expr, is_aggregation: bool) -> Result<Vec<CId>> {
// special case: reference to a tuple that is a relational input
if exprs.ty.as_ref().map_or(false, |x| x.kind.is_tuple()) && exprs.kind.is_ident() {
if exprs.ty.as_ref().is_some_and(|x| x.kind.is_tuple()) && exprs.kind.is_ident() {
// return all contained columns
let input_id = exprs.target_id.as_ref().unwrap();
let id_mapping = self.node_mapping.get(input_id).unwrap();
Expand Down Expand Up @@ -741,7 +741,7 @@ impl Lowerer {

let id = e.target_id.unwrap();
match e.kind {
pl::ExprKind::Ident(_) if e.ty.as_ref().map_or(false, |x| x.kind.is_tuple()) => {
pl::ExprKind::Ident(_) if e.ty.as_ref().is_some_and(|x| x.kind.is_tuple()) => {
res.extend(self.find_selected_all(e, None).with_span(except.span)?);
}
pl::ExprKind::Ident(ident) => {
Expand Down Expand Up @@ -835,7 +835,7 @@ impl Lowerer {
pl::ExprKind::Ident(ident) => {
log::debug!("lowering ident {ident} (target {:?})", expr.target_id);

if expr.ty.as_ref().map_or(false, |x| x.kind.is_tuple()) {
if expr.ty.as_ref().is_some_and(|x| x.kind.is_tuple()) {
// special case: tuple ref
let expr = pl::Expr {
kind: pl::ExprKind::Ident(ident),
Expand Down
2 changes: 1 addition & 1 deletion prqlc/prqlc/src/semantic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn is_ident_or_func_call(expr: &pl::Expr, name: &pr::Ident) -> bool {
match &expr.kind {
pl::ExprKind::Ident(i) if i == name => true,
pl::ExprKind::FuncCall(pl::FuncCall { name: n_expr, .. })
if n_expr.kind.as_ident().map_or(false, |i| i == name) =>
if n_expr.kind.as_ident() == Some(name) =>
{
true
}
Expand Down
2 changes: 1 addition & 1 deletion prqlc/prqlc/src/semantic/resolver/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl pl::PlFold for Resolver<'_> {
}

pl::ExprKind::FuncCall(pl::FuncCall { name, args, .. })
if (name.kind.as_ident()).map_or(false, |i| i.to_string() == "std.not")
if (name.kind.as_ident()).is_some_and(|i| i.to_string() == "std.not")
&& matches!(args[0].kind, pl::ExprKind::Tuple(_)) =>
{
let arg = args.into_iter().exactly_one().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion prqlc/prqlc/src/semantic/resolver/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl super::Resolver<'_> {
// var value is not provided

// is this a relation?
if expected_ty.as_ref().map_or(false, |t| t.is_relation()) {
if expected_ty.as_ref().is_some_and(|t| t.is_relation()) {
// treat this var as a TableDecl
DeclKind::TableDecl(TableDecl {
ty: expected_ty,
Expand Down
6 changes: 3 additions & 3 deletions prqlc/prqlc/src/semantic/resolver/transforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl Resolver<'_> {

let [pattern, value] = unpack::<2>(func.args);

if pattern.ty.as_ref().map_or(false, |x| x.kind.is_array()) {
if pattern.ty.as_ref().is_some_and(|x| x.kind.is_array()) {
return Ok(Expr::new(ExprKind::RqOperator {
name: "std.array_in".to_string(),
args: vec![value, pattern],
Expand Down Expand Up @@ -465,7 +465,7 @@ impl Resolver<'_> {
/// Wraps non-tuple Exprs into a singleton Tuple.
pub(super) fn coerce_into_tuple(&mut self, expr: Expr) -> Result<Expr> {
let is_tuple_ty =
expr.ty.as_ref().map_or(false, |t| t.kind.is_tuple()) && !expr.kind.is_all();
expr.ty.as_ref().is_some_and(|t| t.kind.is_tuple()) && !expr.kind.is_all();
Ok(if is_tuple_ty {
// a helpful check for a common anti-pattern
if let Some(alias) = expr.alias {
Expand Down Expand Up @@ -892,7 +892,7 @@ impl Lineage {
}

// special case: include a tuple
if expr.ty.as_ref().map_or(false, |x| x.kind.is_tuple()) && expr.kind.is_ident() {
if expr.ty.as_ref().is_some_and(|x| x.kind.is_tuple()) && expr.kind.is_ident() {
// this ident is a tuple, which means it much point to an input
let input_id = expr.target_id.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[toolchain]
# Generally run 1 behind latest
channel = "1.83.0"
channel = "1.84.1"
components = ["rustfmt", "clippy"]
# We want two targets: wasm32, and the default target for the platform, which we
# don't list here. (i.e. we use each platform to test each platform)
Expand Down

0 comments on commit e393ab4

Please sign in to comment.