diff --git a/rusqlite-macros/src/lib.rs b/rusqlite-macros/src/lib.rs index 8dda22c..308d5fd 100644 --- a/rusqlite-macros/src/lib.rs +++ b/rusqlite-macros/src/lib.rs @@ -48,7 +48,7 @@ fn try_bind(input: TokenStream) -> Result { return Err(err.to_string()); } if info.count == 0 { - return Ok(input); + return Ok(TokenStream::new()); } if info.count as usize != info.names.len() { return Err("Mixing named and numbered parameters is not supported.".to_string()); diff --git a/rusqlite-macros/tests/test.rs b/rusqlite-macros/tests/test.rs index 785ca9b..f9e9782 100644 --- a/rusqlite-macros/tests/test.rs +++ b/rusqlite-macros/tests/test.rs @@ -20,6 +20,13 @@ fn test_literal() -> Result { Ok(()) } +#[test] +fn test_no_placeholder() -> Result { + let _stmt = Stmt; + __bind!(_stmt "SELECT 1"); + Ok(()) +} + /* FIXME #[test] fn test_raw_string() {