Skip to content

Commit

Permalink
try adding dumb docstrings for testing doc generation
Browse files Browse the repository at this point in the history
  • Loading branch information
GiacomoPope committed Jul 27, 2024
1 parent f8d1937 commit 741a5b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
API Documentation
=================

.. autosummary::
:toctree: generated/

xof_py
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ macro_rules! impl_sponge_shaker_classes {

#[pymethods]
impl $sponge_name {
/// Docstring for the read??
fn read<'py>(&mut self, py: Python<'py>, n: usize) -> PyResult<Bound<'py, PyBytes>> {
PyBytes::new_bound_with(py, n, |bytes| {
self.xof.read(bytes);
Expand Down Expand Up @@ -96,18 +97,21 @@ macro_rules! impl_sponge_shaker_classes {
impl $shaker_name {
#[new]
#[pyo3(signature = (input_bytes = None))]
/// Here is some docstrings...
fn new(input_bytes: Option<&[u8]>) -> Self {
let mut hasher = $hasher::default();
if let Some(initial_data) = input_bytes {
hasher.update(initial_data);
}
Self { hasher }
}


/// This should be the absorb one...
fn absorb(&mut self, input_bytes: &[u8]) {
self.hasher.update(input_bytes);
}

/// This should be the finalize one...
fn finalize(&mut self) -> $sponge_name {
$sponge_name {
xof: self.hasher.finalize_xof_reset(),
Expand Down

0 comments on commit 741a5b1

Please sign in to comment.