mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-11-04 16:28:55 +08:00 
			
		
		
		
	Fix clippy warnings
Allow `unnecessary_wraps` for `check_update` and `check_no_tail`. Remove `check_readonly` (`sqlite3-parser` may help).
This commit is contained in:
		@@ -170,6 +170,7 @@ impl RawStatement {
 | 
			
		||||
        r
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // does not work for PRAGMA
 | 
			
		||||
    #[inline]
 | 
			
		||||
    #[cfg(all(feature = "extra_check", feature = "modern_sqlite"))] // 3.7.4
 | 
			
		||||
    pub fn readonly(&self) -> bool {
 | 
			
		||||
 
 | 
			
		||||
@@ -220,7 +220,6 @@ impl Statement<'_> {
 | 
			
		||||
    /// Will return `Err` if binding parameters fails.
 | 
			
		||||
    #[inline]
 | 
			
		||||
    pub fn query<P: Params>(&mut self, params: P) -> Result<Rows<'_>> {
 | 
			
		||||
        self.check_readonly()?;
 | 
			
		||||
        params.__bind_in(self)?;
 | 
			
		||||
        Ok(Rows::new(self))
 | 
			
		||||
    }
 | 
			
		||||
@@ -718,21 +717,6 @@ impl Statement<'_> {
 | 
			
		||||
        self.conn.decode_result(stmt.finalize())
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[cfg(not(feature = "modern_sqlite"))]
 | 
			
		||||
    #[inline]
 | 
			
		||||
    fn check_readonly(&self) -> Result<()> {
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[cfg(feature = "modern_sqlite")]
 | 
			
		||||
    #[inline]
 | 
			
		||||
    fn check_readonly(&self) -> Result<()> {
 | 
			
		||||
        /*if !self.stmt.readonly() { does not work for PRAGMA
 | 
			
		||||
            return Err(Error::InvalidQuery);
 | 
			
		||||
        }*/
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[cfg(all(feature = "modern_sqlite", feature = "extra_check"))]
 | 
			
		||||
    #[inline]
 | 
			
		||||
    fn check_update(&self) -> Result<()> {
 | 
			
		||||
@@ -755,6 +739,7 @@ impl Statement<'_> {
 | 
			
		||||
 | 
			
		||||
    #[cfg(not(feature = "extra_check"))]
 | 
			
		||||
    #[inline]
 | 
			
		||||
    #[allow(clippy::unnecessary_wraps)]
 | 
			
		||||
    fn check_update(&self) -> Result<()> {
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
@@ -793,6 +778,7 @@ impl Statement<'_> {
 | 
			
		||||
 | 
			
		||||
    #[cfg(not(feature = "extra_check"))]
 | 
			
		||||
    #[inline]
 | 
			
		||||
    #[allow(clippy::unnecessary_wraps)]
 | 
			
		||||
    pub(crate) fn check_no_tail(&self) -> Result<()> {
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user