diff --git a/Cargo.lock b/Cargo.lock index 9ee52db..baa8409 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,7 +16,7 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "booklibrs" -version = "1.0.14" +version = "1.0.15" dependencies = [ "chrono", "fltk 0.15.4 (git+https://github.com/MoAlyousef/fltk-rs)", diff --git a/Cargo.toml b/Cargo.toml index 4476444..c477e59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "booklibrs" -version = "1.0.14" +version = "1.0.15" authors = ["Paranid5 "] edition = "2018" license = "MIT/Apache-2.0" description = "Book libarary project including giveaway operations and gui interface." homepage = "https://github.com/dinaraparanid/Library_rs" -documentation = "https://docs.rs/binartree/1.0.14/booklibrs/" +documentation = "https://docs.rs/binartree/1.0.15/booklibrs/" [dependencies] chrono = "0.4.19" diff --git a/src/actions/book/add_rem/full.rs b/src/actions/book/add_rem/full.rs index d2b38d1..571cd39 100644 --- a/src/actions/book/add_rem/full.rs +++ b/src/actions/book/add_rem/full.rs @@ -194,6 +194,7 @@ pub fn remove_book( /// If you have mistakes in input, /// program will let you know +#[allow(dead_code)] #[deprecated( note = "Used before to add new TheBook. Complains if TheBook with same params exists. Use add_books() instead" )] diff --git a/src/actions/book/add_rem/simple.rs b/src/actions/book/add_rem/simple.rs index c10b1e3..e2e6129 100644 --- a/src/actions/book/add_rem/simple.rs +++ b/src/actions/book/add_rem/simple.rs @@ -257,6 +257,7 @@ pub(crate) fn remove_book_simple( /// from known the book #[inline] +#[allow(dead_code)] pub(crate) fn remove_book_simple2( index: usize, s_index: usize, diff --git a/src/actions/book/info/simple.rs b/src/actions/book/info/simple.rs index 855becd..1646bd5 100644 --- a/src/actions/book/info/simple.rs +++ b/src/actions/book/info/simple.rs @@ -531,6 +531,17 @@ pub fn the_book_info_simple( MessageTheBook::ChangePages, ); + menu.add_emit( + match lang { + Lang::English => "&Change/Customize book genres\t", + Lang::Russian => "&Изменить/Изменить жанры книги\t", + }, + Shortcut::empty(), + MenuFlag::Normal, + s, + MessageTheBook::CustomizeBookGenre, + ); + menu.add_emit( match lang { Lang::English => "&Remove/Remove all books\t", diff --git a/src/actions/giveaway/full.rs b/src/actions/giveaway/full.rs index b6ae343..cbb9d4d 100644 --- a/src/actions/giveaway/full.rs +++ b/src/actions/giveaway/full.rs @@ -2,19 +2,14 @@ extern crate fltk; use crate::{ actions::{giveaway::simple::*, read::utils::check_reader}, - books::{book::Book, book_sys::BookSystem, date::Date, genres::Genres}, + books::{book_sys::BookSystem, genres::Genres}, change::{input3::Input3, Inputable}, reading::read_base::ReaderBase, restore::caretaker::Caretaker, Lang, }; -use fltk::{ - app::{channel, App}, - dialog::alert, - input::*, - prelude::*, -}; +use fltk::{app::App, dialog::alert, input::*}; /// Function that changes /// return date for the book diff --git a/src/actions/giveaway/simple.rs b/src/actions/giveaway/simple.rs index 1f6ba3b..d3ffa0c 100644 --- a/src/actions/giveaway/simple.rs +++ b/src/actions/giveaway/simple.rs @@ -17,7 +17,6 @@ use fltk::{ dialog::alert, input::{Input, IntInput}, prelude::*, - tree::TreeItem, }; use chrono::Local; @@ -280,6 +279,7 @@ pub(crate) fn give_book_known_reader( /// /// Gives book to known reader (user input version) +#[allow(dead_code)] #[deprecated(note = "Used before. Requires input. Consider using give_book_known_reader() instead")] fn give_book_known_reader_input( rind: usize, @@ -710,6 +710,7 @@ pub(crate) fn get_book_known_reader( /// /// Function that gets book from known reader +#[allow(dead_code)] #[deprecated( note = "Used before. Requires user input. Consider using get_book_known_reader() instead" )] diff --git a/src/actions/read/add_rem/full.rs b/src/actions/read/add_rem/full.rs index 01eb577..9c08a64 100644 --- a/src/actions/read/add_rem/full.rs +++ b/src/actions/read/add_rem/full.rs @@ -1,4 +1,3 @@ -extern crate chrono; extern crate fltk; extern crate fltk_calendar; @@ -14,8 +13,6 @@ use crate::{ Lang, }; -use chrono::Datelike; - /// Function that adds reader. /// If you have mistakes in input, /// program will let you know diff --git a/src/actions/read/info/full.rs b/src/actions/read/info/full.rs index abd095f..2c48384 100644 --- a/src/actions/read/info/full.rs +++ b/src/actions/read/info/full.rs @@ -1,34 +1,17 @@ extern crate fltk; -use fltk::{ - app, - app::App, - dialog::alert, - draw, - frame::Frame, - group::VGrid, - input::{Input, IntInput}, - menu::{MenuBar, MenuFlag}, - prelude::*, - table::Table, - window::SingleWindow, -}; +use fltk::{app, app::App, input::Input, prelude::*}; use crate::{ - actions::{ - book::info::simple::book_info_simple, - giveaway::simple::{get_book_known_reader, give_book_known_reader}, - read::{change::*, info::simple::reader_info_simple, utils::check_reader}, - tables::*, - }, - books::{book_sys::BookSystem, date::Date, genres::Genres}, + actions::read::{info::simple::reader_info_simple, utils::check_reader}, + books::{book_sys::BookSystem, genres::Genres}, change::{input3::Input3, Inputable}, reading::read_base::ReaderBase, restore::caretaker::Caretaker, Lang, }; -use std::{cell::RefCell, cmp::max, rc::Rc}; +use std::{cell::RefCell, rc::Rc}; /// Function that gives info about reader. /// If you have mistakes in input, diff --git a/src/books/genres.rs b/src/books/genres.rs index 08bd63e..be13457 100644 --- a/src/books/genres.rs +++ b/src/books/genres.rs @@ -132,6 +132,7 @@ impl Genres { /// Deletes all genres from current genres keeper #[inline] + #[allow(dead_code)] pub(crate) fn clear(&mut self) -> &mut Self { self.genres.clear(); self diff --git a/src/lib.rs b/src/lib.rs index 204cc7d..52447d5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,6 +9,8 @@ pub mod change; pub mod reading; pub mod restore; +#[allow(dead_code)] +#[allow(unused_imports)] #[deprecated(note = "It has been a lot of changes since I need it,\ since everything works correct, I have no need for tests")] mod tests; diff --git a/src/reading/reader.rs b/src/reading/reader.rs index 1ce55ac..02b637d 100644 --- a/src/reading/reader.rs +++ b/src/reading/reader.rs @@ -138,6 +138,7 @@ impl Reader { /// else none #[inline] + #[allow(dead_code)] pub(crate) fn find_book_first(&self, book: &Rc>) -> Option { self.books .iter() @@ -149,6 +150,7 @@ impl Reader { /// else none #[inline] + #[allow(dead_code)] pub(crate) fn find_book_last(&self, book: &Rc>) -> Option { self.books .iter() diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 84a1285..825cd6f 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -1,2 +1,4 @@ +#[allow(dead_code)] mod book_test; +#[allow(dead_code)] mod reader_test;