MCPcopy Create free account

hub / github.com/corrode/refactoring-rust / functions

Functions302 in github.com/corrode/refactoring-rust

↓ 10 callersFunctionparse
(input: &str)
solutions/26_env_file_parser.rs:284
↓ 9 callersMethodparse
(args: &[&str])
solutions/27_mini_redis.rs:59
↓ 7 callersFunctioncommit
(out: &mut HashMap<String, String>, key: &mut String, value: &mut String, quoted: bool)
solutions/26_env_file_parser.rs:268
↓ 6 callersFunctionparse_env
(content: &str)
solutions/26_env_file_parser.rs:78
↓ 5 callersFunctionparse
(input: &str)
examples/26_env_file_parser.rs:46
↓ 4 callersFunctionhandle
(db: &mut Db, args: &[&str])
solutions/27_mini_redis.rs:105
↓ 4 callersFunctionhandle
(db: &mut Db, args: &[&str])
examples/27_mini_redis.rs:30
↓ 4 callersMethodnext
(&mut self)
solutions/19_iterators.rs:33
↓ 3 callersFunctionevens
Return the even numbers below `max` as a lazy iterator. Solution highlights: - `impl Iterator<Item = u32>` returns the iterator without allocating. -
solutions/03_even_numbers.rs:8
↓ 3 callersMethodtype_name
(&self)
solutions/27_mini_redis.rs:21
↓ 3 callersFunctionwords
(ws: &[&str])
examples/13_spell_check.rs:25
↓ 3 callersFunctionwrong_type
(actual: &str)
solutions/27_mini_redis.rs:160
↓ 2 callersFunctioncfg
(pairs: &[(&str, &str)])
solutions/25_config_loader.rs:59
↓ 2 callersFunctioncfg
(pairs: &[(&str, &str)])
examples/25_config_loader.rs:39
↓ 2 callersFunctiondict
(ws: &[&str])
solutions/13_spell_check.rs:22
↓ 2 callersFunctionparsed
( map: &HashMap<String, String>, key: &'static str, default: &str, )
solutions/25_config_loader.rs:41
↓ 1 callersFunctionapply_commands
(input: Vec<(String, Command)>)
solutions/20_transformer.rs:17
↓ 1 callersFunctionapply_commands
(input: Vec<(String, Command)>)
examples/20_transformer.rs:10
↓ 1 callersFunctionexecute
(db: &mut Db, cmd: Command)
solutions/27_mini_redis.rs:119
↓ 1 callersFunctionfib
Generate the Fibonacci sequence. This works, but make it nicer. (Don't worry about the signature; you have free rein to change that code)
examples/19_iterators.rs:6
↓ 1 callersFunctionfirst_n
(n: usize)
examples/19_iterators.rs:16
↓ 1 callersFunctionparse_env
(content: &str)
examples/26_env_file_parser.rs:13
↓ 1 callersFunctionread_file_contents
(path: &str)
solutions/09_error_handling.rs:11
↓ 1 callersFunctionread_file_contents
(path: &str)
examples/09_error_handling.rs:6
↓ 1 callersFunctionsort_range
(values: &mut [i32], lo: usize, hi: usize)
examples/22_quicksort.rs:18
↓ 1 callersFunctionstep
( state: State, c: char, key: &mut String, value: &mut String, quoted: &mut bool, line
solutions/26_env_file_parser.rs:121
↓ 1 callersFunctionwrite_tmp
(name: &str, contents: &str)
solutions/09_error_handling.rs:21
↓ 1 callersFunctionwrite_tmp
(name: &str, contents: &str)
examples/09_error_handling.rs:23
Functionadults_total
(rooms: &[RoomOccupancy])
solutions/14_room_occupancy.rs:13
Functionadults_total
(rooms: &[RoomOccupancy])
examples/14_room_occupancy.rs:10
Functionall_distinct_returns_some_element
()
solutions/16_mode.rs:37
Functionall_distinct_returns_some_element
()
examples/16_mode.rs:38
Functionall_none
()
solutions/07_optional_values.rs:34
Functionall_none
()
examples/07_optional_values.rs:31
Functionall_the_same_collapses_to_one
()
solutions/11_dedup_runs.rs:37
Functionall_the_same_collapses_to_one
()
examples/11_dedup_runs.rs:45
Functionall_valid
()
solutions/08_parse_ints.rs:21
Functionall_valid
()
examples/08_parse_ints.rs:22
Functionalready_sorted_and_reversed
()
solutions/22_quicksort.rs:44
Functionalready_sorted_and_reversed
()
examples/22_quicksort.rs:58
Functionappend_zero_is_a_noop
()
solutions/20_transformer.rs:58
Functionappend_zero_is_a_noop
()
examples/20_transformer.rs:62
Functionapplies_each_command
()
solutions/20_transformer.rs:42
Functionapplies_each_command
()
examples/20_transformer.rs:46
Functionascii
()
solutions/04_truncate_string.rs:26
Functionascii
()
examples/04_truncate_string.rs:14
Functionchild_ages
(rooms: &[RoomOccupancy])
solutions/14_room_occupancy.rs:25
Functionchild_ages
(rooms: &[RoomOccupancy])
examples/14_room_occupancy.rs:36
Functionchildren_total
(rooms: &[RoomOccupancy])
solutions/14_room_occupancy.rs:17
Functionchildren_total
(rooms: &[RoomOccupancy])
examples/14_room_occupancy.rs:18
Methodclassify
(status: u16)
solutions/24_http_response_router.rs:30
Functioncollapses_internal_whitespace
()
solutions/17_trim_log_line.rs:28
Functioncollapses_internal_whitespace
()
examples/17_trim_log_line.rs:56
Functioncollapses_runs_but_keeps_separated_repeats
()
solutions/11_dedup_runs.rs:19
Functioncollapses_runs_but_keeps_separated_repeats
()
examples/11_dedup_runs.rs:27
Functioncomposes_inside_out
()
solutions/21_fun_strings_ext.rs:57
Functioncomposes_inside_out
()
examples/21_fun_strings_ext.rs:44
Functiondebug_truthy_values
()
solutions/25_config_loader.rs:86
Functiondebug_truthy_values
()
examples/25_config_loader.rs:61
Functiondedup_runs
Collapse consecutive duplicate values, keeping one per run. Solution highlights: - `Vec::dedup` removes consecutive equal elements in place. - It tou
solutions/11_dedup_runs.rs:9
Functiondedup_runs
Collapse consecutive duplicate values, keeping one per run. `[1, 2, 4, 5, 5, 5, 5, 25, 5]` becomes `[1, 2, 4, 5, 25, 5]`. Only *adjacent* duplicates
examples/11_dedup_runs.rs:10
Methoddefault
()
solutions/19_iterators.rs:25
Functiondefaults_when_missing
()
solutions/25_config_loader.rs:67
Functiondefaults_when_missing
()
examples/25_config_loader.rs:47
Functiondescribe
Classify a number as "prime", "square", "nothing", or "something else". Solution highlights: - Or-patterns nest inside `Some(_)` since Rust 1.53. - T
solutions/02_better_match.rs:8
Functiondescribe
Classify a number as "prime", "square", "nothing", or "something else".
examples/02_better_match.rs:3
Functiondetects_misspellings
()
solutions/13_spell_check.rs:27
Functiondetects_misspellings
()
examples/13_spell_check.rs:30
Functiondotfile_without_extension
()
solutions/05_path.rs:44
Functiondotfile_without_extension
()
examples/05_path.rs:40
Functionduplicates_and_negatives
()
solutions/22_quicksort.rs:50
Functionduplicates_and_negatives
()
examples/22_quicksort.rs:64
Functionempty
()
solutions/03_even_numbers.rs:23
Functionempty
()
solutions/11_dedup_runs.rs:27
Functionempty
()
solutions/07_optional_values.rs:28
Functionempty
()
examples/03_even_numbers.rs:29
Functionempty
()
examples/11_dedup_runs.rs:35
Functionempty
()
examples/07_optional_values.rs:25
Functionempty_and_single
()
solutions/22_quicksort.rs:38
Functionempty_and_single
()
examples/22_quicksort.rs:52
Functionempty_input
()
solutions/13_spell_check.rs:34
Functionempty_input
()
solutions/08_parse_ints.rs:33
Functionempty_input
()
examples/13_spell_check.rs:37
Functionempty_input
()
examples/08_parse_ints.rs:34
Functionempty_input_yields_empty_output
()
solutions/20_transformer.rs:53
Functionempty_input_yields_empty_output
()
examples/20_transformer.rs:57
Functionempty_key_is_an_error
()
solutions/26_env_file_parser.rs:375
Functionempty_set_excludes_nothing
()
solutions/12_excluded_path.rs:43
Functionempty_set_excludes_nothing
()
examples/12_excluded_path.rs:42
Functionempty_string
()
solutions/01_starts_with_uppercase.rs:32
Functionempty_string
()
examples/01_starts_with_uppercase.rs:30
Functionempty_value_is_allowed
()
solutions/26_env_file_parser.rs:319
Functionempty_value_is_allowed
()
examples/26_env_file_parser.rs:81
Functionescape_sequences_in_quoted_value
()
solutions/26_env_file_parser.rs:357
Functionevens
Return the even numbers below `max`. This works right now, but it eagerly builds a whole `Vec` and hand-rolls the loop. Can you return something lazi
examples/03_even_numbers.rs:7
Functionexcludes_under_prefix
()
solutions/12_excluded_path.rs:28
Functionexcludes_under_prefix
()
examples/12_excluded_path.rs:27
Functionfinds_max_adults
()
solutions/14_room_occupancy.rs:60
Functionfinds_max_adults
()
examples/14_room_occupancy.rs:74
Functionfinds_mode
()
solutions/16_mode.rs:27
next →1–100 of 302, ranked by callers