Skip to content

Commit b1c2922

Browse files
committed
code clean part 2
1 parent bd9c3f4 commit b1c2922

File tree

13 files changed

+31
-35
lines changed

13 files changed

+31
-35
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "booklibrs"
3-
version = "1.0.14"
3+
version = "1.0.15"
44
authors = ["Paranid5 <dinaraparanid@gmail.com>"]
55
edition = "2018"
66
license = "MIT/Apache-2.0"
77
description = "Book libarary project including giveaway operations and gui interface."
88
homepage = "https://github.com/dinaraparanid/Library_rs"
9-
documentation = "https://docs.rs/binartree/1.0.14/booklibrs/"
9+
documentation = "https://docs.rs/binartree/1.0.15/booklibrs/"
1010

1111
[dependencies]
1212
chrono = "0.4.19"

src/actions/book/add_rem/full.rs

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ pub fn remove_book(
194194
/// If you have mistakes in input,
195195
/// program will let you know
196196
197+
#[allow(dead_code)]
197198
#[deprecated(
198199
note = "Used before to add new TheBook. Complains if TheBook with same params exists. Use add_books() instead"
199200
)]

src/actions/book/add_rem/simple.rs

+1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ pub(crate) fn remove_book_simple(
257257
/// from known the book
258258
259259
#[inline]
260+
#[allow(dead_code)]
260261
pub(crate) fn remove_book_simple2(
261262
index: usize,
262263
s_index: usize,

src/actions/book/info/simple.rs

+11
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,17 @@ pub fn the_book_info_simple(
531531
MessageTheBook::ChangePages,
532532
);
533533

534+
menu.add_emit(
535+
match lang {
536+
Lang::English => "&Change/Customize book genres\t",
537+
Lang::Russian => "&Изменить/Изменить жанры книги\t",
538+
},
539+
Shortcut::empty(),
540+
MenuFlag::Normal,
541+
s,
542+
MessageTheBook::CustomizeBookGenre,
543+
);
544+
534545
menu.add_emit(
535546
match lang {
536547
Lang::English => "&Remove/Remove all books\t",

src/actions/giveaway/full.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@ extern crate fltk;
22

33
use crate::{
44
actions::{giveaway::simple::*, read::utils::check_reader},
5-
books::{book::Book, book_sys::BookSystem, date::Date, genres::Genres},
5+
books::{book_sys::BookSystem, genres::Genres},
66
change::{input3::Input3, Inputable},
77
reading::read_base::ReaderBase,
88
restore::caretaker::Caretaker,
99
Lang,
1010
};
1111

12-
use fltk::{
13-
app::{channel, App},
14-
dialog::alert,
15-
input::*,
16-
prelude::*,
17-
};
12+
use fltk::{app::App, dialog::alert, input::*};
1813

1914
/// Function that changes
2015
/// return date for the book

src/actions/giveaway/simple.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use fltk::{
1717
dialog::alert,
1818
input::{Input, IntInput},
1919
prelude::*,
20-
tree::TreeItem,
2120
};
2221

2322
use chrono::Local;
@@ -280,6 +279,7 @@ pub(crate) fn give_book_known_reader(
280279
///
281280
/// Gives book to known reader (user input version)
282281
282+
#[allow(dead_code)]
283283
#[deprecated(note = "Used before. Requires input. Consider using give_book_known_reader() instead")]
284284
fn give_book_known_reader_input(
285285
rind: usize,
@@ -710,6 +710,7 @@ pub(crate) fn get_book_known_reader(
710710
///
711711
/// Function that gets book from known reader
712712
713+
#[allow(dead_code)]
713714
#[deprecated(
714715
note = "Used before. Requires user input. Consider using get_book_known_reader() instead"
715716
)]

src/actions/read/add_rem/full.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate chrono;
21
extern crate fltk;
32
extern crate fltk_calendar;
43

@@ -14,8 +13,6 @@ use crate::{
1413
Lang,
1514
};
1615

17-
use chrono::Datelike;
18-
1916
/// Function that adds reader.
2017
/// If you have mistakes in input,
2118
/// program will let you know

src/actions/read/info/full.rs

+4-21
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,17 @@
11
extern crate fltk;
22

3-
use fltk::{
4-
app,
5-
app::App,
6-
dialog::alert,
7-
draw,
8-
frame::Frame,
9-
group::VGrid,
10-
input::{Input, IntInput},
11-
menu::{MenuBar, MenuFlag},
12-
prelude::*,
13-
table::Table,
14-
window::SingleWindow,
15-
};
3+
use fltk::{app, app::App, input::Input, prelude::*};
164

175
use crate::{
18-
actions::{
19-
book::info::simple::book_info_simple,
20-
giveaway::simple::{get_book_known_reader, give_book_known_reader},
21-
read::{change::*, info::simple::reader_info_simple, utils::check_reader},
22-
tables::*,
23-
},
24-
books::{book_sys::BookSystem, date::Date, genres::Genres},
6+
actions::read::{info::simple::reader_info_simple, utils::check_reader},
7+
books::{book_sys::BookSystem, genres::Genres},
258
change::{input3::Input3, Inputable},
269
reading::read_base::ReaderBase,
2710
restore::caretaker::Caretaker,
2811
Lang,
2912
};
3013

31-
use std::{cell::RefCell, cmp::max, rc::Rc};
14+
use std::{cell::RefCell, rc::Rc};
3215

3316
/// Function that gives info about reader.
3417
/// If you have mistakes in input,

src/books/genres.rs

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ impl Genres {
132132
/// Deletes all genres from current genres keeper
133133
134134
#[inline]
135+
#[allow(dead_code)]
135136
pub(crate) fn clear(&mut self) -> &mut Self {
136137
self.genres.clear();
137138
self

src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pub mod change;
99
pub mod reading;
1010
pub mod restore;
1111

12+
#[allow(dead_code)]
13+
#[allow(unused_imports)]
1214
#[deprecated(note = "It has been a lot of changes since I need it,\
1315
since everything works correct, I have no need for tests")]
1416
mod tests;

src/reading/reader.rs

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ impl Reader {
138138
/// else none
139139
140140
#[inline]
141+
#[allow(dead_code)]
141142
pub(crate) fn find_book_first(&self, book: &Rc<RefCell<Book>>) -> Option<usize> {
142143
self.books
143144
.iter()
@@ -149,6 +150,7 @@ impl Reader {
149150
/// else none
150151
151152
#[inline]
153+
#[allow(dead_code)]
152154
pub(crate) fn find_book_last(&self, book: &Rc<RefCell<Book>>) -> Option<usize> {
153155
self.books
154156
.iter()

src/tests/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
#[allow(dead_code)]
12
mod book_test;
3+
#[allow(dead_code)]
24
mod reader_test;

0 commit comments

Comments
 (0)