Skip to content

Commit e13e59f

Browse files
authored
fix: file list overflow (#369)
* Fix overflow of single table cell (.bcol) * Fix statusbar covering up table * Run "cargo clippy --fix"
1 parent 16d3794 commit e13e59f

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

src/addon/cors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ mod tests {
296296
String::from("Content-Length"),
297297
])
298298
);
299-
assert_eq!(cors_config.allow_credentials, false);
299+
assert!(!cors_config.allow_credentials);
300300
assert_eq!(cors_config.max_age, None);
301301
assert_eq!(cors_config.expose_headers, None);
302302
assert_eq!(cors_config.request_headers, None);
@@ -327,7 +327,7 @@ mod tests {
327327
String::from("Content-Type"),
328328
])
329329
);
330-
assert_eq!(cors_config.allow_credentials, false);
330+
assert!(!cors_config.allow_credentials);
331331
assert_eq!(cors_config.max_age, Some(43200));
332332
assert_eq!(cors_config.expose_headers, None);
333333
assert_eq!(cors_config.request_headers, None);

src/addon/file_server/scoped_file_system.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ mod tests {
190190
#[test]
191191
fn normalizes_an_arbitrary_path() {
192192
let arbitrary_path = PathBuf::from("docs/collegue/cs50/lectures/../code/voting_excecise");
193-
let normalized = ScopedFileSystem::normalize_path(&arbitrary_path.clone());
193+
let normalized = ScopedFileSystem::normalize_path(&arbitrary_path);
194194

195195
assert_eq!(
196196
normalized.to_str().unwrap(),
@@ -204,7 +204,7 @@ mod tests {
204204
let resolved_entry = sfs.resolve(PathBuf::from("assets/logo.svg")).await.unwrap();
205205

206206
if let Entry::File(file) = resolved_entry {
207-
assert_eq!(file.metadata.is_file(), true);
207+
assert!(file.metadata.is_file());
208208
} else {
209209
panic!("Found a directory instead of a file in the provied path");
210210
}
@@ -233,6 +233,6 @@ mod tests {
233233
.resolve(PathBuf::from("assets/unexistent_file.doc"))
234234
.await;
235235

236-
assert_eq!(resolved_entry.is_err(), true);
236+
assert!(resolved_entry.is_err());
237237
}
238238
}

src/addon/file_server/template/explorer.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
font-family: var(--font);
2525
font-weight: var(--font-weight);
2626
margin: 0 auto;
27-
max-height: calc(100vh - 2rem);
27+
max-height: calc(100vh - 3.3rem);
2828
min-width: var(--min-width);
2929
overflow-y: auto;
3030
padding: 0;
@@ -49,6 +49,10 @@
4949
padding: .15rem 0;
5050
}
5151
52+
.bcol {
53+
overflow: hidden;
54+
}
55+
5256
#explorer .hrow .hcol:first-child,
5357
#explorer .hrow .hcol:last-child {
5458
border-right: none;

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ mod tests {
126126
let mut expect = Cli::default();
127127

128128
expect.host = "192.168.0.1".parse().unwrap();
129-
expect.port = 54200 as u16;
129+
expect.port = 54200_u16;
130130

131131
assert_eq!(from_args, expect);
132132
}

src/config/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ mod tests {
8282
let host = IpAddr::V4(Ipv4Addr::new(192, 168, 0, 1));
8383
let port = 7878;
8484
let config = ConfigFile::parse_toml(file_contents).unwrap();
85-
let mut root_dir = PathBuf::from(std::env::current_dir().unwrap());
85+
let mut root_dir = std::env::current_dir().unwrap();
8686

8787
root_dir.push("./fixtures");
8888

src/utils/url_encode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ mod tests {
5555
#[test]
5656
fn decodes_uri() {
5757
let file_path = "these%20are%20important%20files/do_not_delete/file%20name.txt";
58-
let file_path = decode_uri(&file_path);
58+
let file_path = decode_uri(file_path);
5959
let file_path = file_path.to_str().unwrap();
6060

6161
assert_eq!(

0 commit comments

Comments
 (0)