(row: SessionRow)
| 51 | |
| 52 | impl From<SessionRow> for Viewer { |
| 53 | fn from(row: SessionRow) -> Self { |
| 54 | let repo_ids: Vec<RepoId> = row.write_repo_ids.into_iter().map(RepoId::from).collect(); |
| 55 | |
| 56 | let selected_repo_id: RepoId = match row.selected_repository_id { |
| 57 | Some(uuid) => uuid.into(), |
| 58 | None => RepoId::wiki(), |
| 59 | }; |
| 60 | |
| 61 | Viewer { |
| 62 | write_repo_ids: repo_ids.to_owned().into(), |
| 63 | read_repo_ids: repo_ids.into(), |
| 64 | session_id: Some(row.session_id), |
| 65 | context_repo_id: selected_repo_id, |
| 66 | super_user: false, |
| 67 | user_id: row.user_id.to_string(), |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | impl From<(String, Option<SessionRow>)> for Viewer { |
nothing calls this directly
no outgoing calls
no test coverage detected