Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- "master"

schedule:
- cron: "0 3 * * 0" # Every sunday at 3am UTC.
- cron: "0 3 * * 0" # Every Sunday at 3am UTC.

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Run tests
run: cargo nextest run --no-fail-fast --hide-progress-bar

- name: Run Doctests
run: cargo test --doc

linting:
needs: build
runs-on: ubuntu-latest
Expand Down
13 changes: 8 additions & 5 deletions src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ impl<'a> Analysis<'a> {
/// let options = AnalysisOptions::default();
/// let mut analysis = Analysis::new(&options);
///
/// let result = analysis.analyze_expr(&AnalysisContext::default(), &expr, Type::Number);
/// let result = analysis.analyze_expr(&mut AnalysisContext::default(), &expr, Type::Number);
/// assert!(result.is_ok());
/// ```
pub fn analyze_expr(
Expand Down Expand Up @@ -1724,11 +1724,14 @@ impl<'a> Analysis<'a> {
///
/// # Examples
///
/// ```ignore
/// ```
/// use eventql_parser::Type;
/// use eventql_parser::prelude::{AnalysisOptions, name_to_type};
///
/// let opts = AnalysisOptions::default();
/// assert_eq!(name_to_type(&opts, "String"), Some(Type::String));
/// assert_eq!(name_to_type(&opts, "INT"), Some(Type::Number));
/// assert_eq!(name_to_type(&opts, "unknown"), None);
/// assert!(matches!(name_to_type(&opts, "String"), Some(Type::String)));
/// assert!(matches!(name_to_type(&opts, "INT"), Some(Type::Number)));
/// assert!(name_to_type(&opts, "unknown").is_none());
/// ```
pub fn name_to_type(opts: &AnalysisOptions, name: &str) -> Option<Type> {
if name.eq_ignore_ascii_case("string") {
Expand Down
Loading