Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
carllerche committed Jan 24, 2025
1 parent 2bc126e commit e0fc2ae
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 584 deletions.
3 changes: 0 additions & 3 deletions src/core/src/schema/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ use super::{
Name,
};
use crate::{ast, stmt};

// TODO: remove
use crate::schema::{ColumnId, IndexId, TableId};
16 changes: 3 additions & 13 deletions src/core/src/schema/app/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,12 @@ impl Model {
.map(|pk_field| &self.fields[pk_field.index])
}

pub fn primary_key_primitives<'a>(&'a self) -> impl Iterator<Item = &'a FieldPrimitive> + 'a {
pub(crate) fn primary_key_primitives<'a>(
&'a self,
) -> impl Iterator<Item = &'a FieldPrimitive> + 'a {
self.primary_key_fields()
.map(|field| field.ty.expect_primitive())
}

pub(crate) fn primary_key_primitives_mut<'a>(
&'a mut self,
) -> impl Iterator<Item = &'a mut FieldPrimitive> + 'a {
// Some stupidly annoying code to avoid unsafe...
let mut fields = self.fields.iter_mut().map(Some).collect::<Vec<_>>();
self.primary_key
.fields
.iter()
.map(move |pk_field| fields[pk_field.index].take().unwrap())
.map(|field| field.ty.expect_primitive_mut())
}
}

impl ModelId {
Expand Down
3 changes: 0 additions & 3 deletions src/core/src/schema/db.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
mod column;
pub use column::{Column, ColumnId};

mod context;
pub(super) use context::Context;

mod index;
pub use index::{Index, IndexColumn, IndexId, IndexOp, IndexScope};

Expand Down
23 changes: 0 additions & 23 deletions src/core/src/schema/db/context.rs

This file was deleted.

4 changes: 0 additions & 4 deletions src/core/src/schema/db/table.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
mod builder;

mod pk;
pub use pk::TablePrimaryKey;

use super::*;

use crate::schema::{Model, Name};

use std::fmt;

/// A database table
Expand Down
Loading

0 comments on commit e0fc2ae

Please sign in to comment.