MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / new_unchecked

Method new_unchecked

src/sql-parser/src/ast/defs/name.rs:130–135  ·  view source on GitHub ↗

Create a new [`Ident`] _without checking any of our invariants_. NOTE: Generally you __should not use this function__! If you're trying to create an [`Ident`] from a `&'static str` you know is valid, use the [`ident!`] macro. For all other use cases, see [`Ident::new`] which correctly checks our invariants. [`ident!`]: [`mz_sql_parser::ident`]

(value: S)

Source from the content-addressed store, hash-verified

128 ///
129 /// [`ident!`]: [`mz_sql_parser::ident`]
130 pub fn new_unchecked<S: Into<String>>(value: S) -> Self {
131 let s = value.into();
132 mz_ore::soft_assert_no_log!(s.len() <= Self::MAX_LENGTH);
133
134 Ident(s)
135 }
136
137 /// Generate a valid [`Ident`] with the provided `prefix` and `suffix`.
138 ///

Callers

nothing calls this directly

Calls 1

IdentClass · 0.85

Tested by

no test coverage detected