Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overhaul the safe/unsafe contracts of the library & refactor as necessary #12

Closed
8 tasks done
joseluis opened this issue Oct 23, 2021 · 0 comments
Closed
8 tasks done
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Comments

@joseluis
Copy link
Collaborator

joseluis commented Oct 23, 2021

I must probably make several parts of this library unsafe. Right now the implied safe contract of the library is broken because of the presence of extra contracts.

Every function with extra contracts that Rust can't enforce automatically, which the user who must follow in order to avoid undefined behaviour, should be marked as unsafe.

Those are:

  • Nc & NcDirect constructors and destructors
  • Nc.stdplane
  • Nc.stdplane_const
  • NcPlane.top
  • NcPlane.bottom
  • NcPlane.notcurses
  • NcPlane.notcurses_const
  • NcVisual.blit

...

@joseluis joseluis added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Oct 23, 2021
@joseluis joseluis self-assigned this Oct 23, 2021
joseluis added a commit that referenced this issue Nov 19, 2021
- mark unsafe the `Nc` & `NcDirect` constructors & destructors.
- add documentation about the contract.
- update docs & examples.
- rustfmt.
joseluis added a commit that referenced this issue Nov 19, 2021
- mark unsafe the `Nc` methods `stdplane` & `stdplane_const`.
- add documentation about the contract.
- update docs & examples.
joseluis added a commit that referenced this issue Nov 19, 2021
- mark unsafe the `Nc` methods `stdplane` & `stdplane_const`.
- add documentation about the contract.
- update docs & examples.
joseluis added a commit that referenced this issue Nov 20, 2021
- mark unsafe the `NcPlane` methods: `bottom`, `top`, `notcurses`, `notcurses_const`.
- add documentation about the contract.
- update docs & examples.
joseluis added a commit that referenced this issue Nov 20, 2021
- add documentation about the contract.
- update docs & examples.
@joseluis joseluis closed this as completed Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant